Append is not cancel safe
まだ誰も着手していません。
評価
調査の方向性
Start by tracing append_record through the in-memory updates described in the issue, then inspect mem/queue.rs:87 and the record_metas and concatenated_records updates. Reproduce cancellation with a tokio timeout or task cancellation. Done means cancellation cannot leave disk and RAM inconsistent, cause the reported panic, or make reloading identify corruption.
索引モデルが issue の本文から書いたものです。
説明
If append_record is not "polled to its end", for instance if it is wrapped in tokio timeout, or if the task running it is cancelled,
then we can end up in a corrupted state.
The code looks as follows
- get next record position by looking at the last record in RAM.
- write on disk
- (C) write on RAM
If the task is stopped in the middle of (C), we end up in a state where what is on disk does not match what is in RAM.
In particular, on the next add, we will use a record position that might actually already be on disk.
As we reload the mrecordlog from disk, this is identified as a corruption.
This has been observed in prod.
A second case also observed is a straight panic.
Here the cause the preemption is assumed to have happened after we appended the record metas
and before we had populated the concatenated_records rolling buffer.
self.record_metas.push(record_meta);
self.concatenated_records.extend(payload);
The panic reported is
2024-02-28T23:41:54Z app[7816406b969758] iad [info]thread 'tokio-runtime-worker' panicked at /usr/local/cargo/git/checkouts/mrecordlog-34aad39ce3e0e659/bc6a998/src/mem/queue.rs:87:46:
2024-02-28T23:41:54Z app[7816406b969758] iad [info]slice index starts at 928 but ends at 0
- 主要言語
- Rust
- スター
- 33
- フォーク
- 11
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quickwit-oss/mrecordlog のほかの issue
-
Save RAMオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
quickwit-oss/mrecordlog#57 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
quickwit-oss/mrecordlog#51 ·
-
Manual sync mode再び着手できるかも @guilload が 1235 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
quickwit-oss/mrecordlog#42 · 担当者 1 名 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
quickwit-oss/mrecordlog#41 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
quickwit-oss/mrecordlog#37 ·
quickwit-oss/mrecordlog の issue をすべて見る
似ている issue
-
[M09] Silence parser misreads ffmpeg times in scientific notation (6.25e-05 → 6.25 s)対応中かも @G-darshan-32 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
clipy-recorder/clipy#164 · コメント 1 件 ·
-
p2 ready-mac
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
quickwit-oss/tantivy#3299 ·
メンテナーはふだん 1 日以内に返信
-
P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
arcships/dim#2294 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`stream enable` fails with "already enabled" on every fresh session since streaming became always-onオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vercel-labs/agent-browser#2797 ·
メンテナーはふだん 1 日以内に返信