Corrupted overlaybd.commit contains duplicated blocks and stalls TCMU / Pod sandbox creation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with BkDownload::download_blob() in src/bk_download.cpp and trace how src->pread() results affect buffer writes and offset updates. Add a focused test that injects zero and short positive reads while bytes remain; done means unread buffer contents are never written or accepted as downloaded data. The issue reports no deterministic end-to-end reproducer.
索引モデルが issue の本文から書いたものです。
説明
What happened in your environment?
We intermittently see a node stop creating Pod sandboxes. On one occasion, a Pod retried sandbox creation more than 2,000 times over approximately seven hours. OverlayBD TCMU reported repeated CRC errors. Snapshot cleanup was stuck in unlinkat() while removing a TCMU configfs LUN link, and containerd goroutines attempting to prepare snapshots were blocked on a metadata snapshotter lock. The “sandbox name is reserved” errors were part of the resulting failure chain: an earlier RunPodSandbox attempt had reserved the name before getting stuck during snapshot preparation, so subsequent attempts using the same name were rejected by containerd.
We traced one affected snapshot to a corrupted local overlaybd.commit. overlaybd-zfile --verify reported checksum/CRC failures:
pread:checksum verification failed after retries
zfile_validation_check:crc check error in block 203963
We downloaded the corresponding layer independently and compared it with the local file. The file size was 663,820,800 bytes. Exactly nine 256 KiB chunks differed. Each bad chunk was an exact copy of an earlier chunk:
Local chunk 2038 == reference chunk 2037
Local chunk 2039 == reference chunk 2037
Local chunk 2129 == reference chunk 2128
Local chunk 2147 == reference chunk 2146
Local chunk 2184 == reference chunk 2183
Local chunk 2241 == reference chunk 2240
Local chunk 2320 == reference chunk 2319
Local chunk 2339 == reference chunk 2338
Local chunk 2464 == reference chunk 2463
In the current upstream BkDownload::download_blob() implementation, a negative src->pread() result is retried, but a zero or short positive result is accepted. The code then writes count bytes from the buffer and advances the offset by count. If fewer than count bytes were read, this appears capable of writing stale buffer contents. The observed duplicated chunks are consistent with that failure mode, but we did not capture the actual pread() return values during the incident.
We have observed the same pattern in multiple incidents: many corrupted blocks are exact copies of valid blocks. This closely resembles the failure mode described above for a zero-length pread() result, although we have not captured such a return value directly. Could the pread() return-value handling be hardened to prevent an empty read from writing stale buffer contents and potentially leaving the entire node unable to create PodSandboxes?
What did you expect to happen?
-
A zero or short read before the expected end of the source should be handled explicitly; unread buffer bytes should never be written as valid downloaded data.
-
A corrupted local committed layer should not continue to be used without detection or recovery.
-
Snapshot/device cleanup should not remain blocked indefinitely after the underlying read failure.
How can we reproduce it?
The production failure is intermittent; we do not yet have a deterministic end-to-end reproducer. A focused test for the suspected downloader issue would inject a zero or short positive return from src->pread() while bytes remain and verify that no stale buffer data is written or accepted.
What is the version of your Overlaybd?
-
OverlayBD version/commit: 1.0.16
-
OverlayBD snapshotter version/commit: 1.4.3
-
containerd version: 2.1.6
-
Linux distribution and kernel: anolis os 5.10.134-16.3.al8.x86_64
What is your OS environment?
anolis 8
Are you willing to submit PRs to fix it?
- Yes, I am willing to fix it.
- 主要言語
- C++
- スター
- 447
- フォーク
- 102
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
containerd/overlaybd のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
containerd/overlaybd#382 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
containerd/overlaybd#380 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
containerd/overlaybd#361 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
containerd/overlaybd#357 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
containerd/overlaybd#326 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
containerd/overlaybd の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itself対応中かも @fedonman が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SparseLinearAlgebra/spla#316 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 3 日以内に返信