Core: A retried transaction commits staged manifests with the sequence number and first row ID of the first attempt

オープン
#19,186 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@shivadarshan-devadiga がすでに取り組んでいます。

2026年11月29日 から。

  • #19187 @shivadarshan-devadiga による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
backend, databases

調査の方向性

Start with SnapshotProducer.manifestsWithMetadata and ManifestFilterManager.filteredManifests, whose caches are described as returning results from the first transaction attempt. Trace the retry path and the listed append and delete reproductions in core, then check that FILE_A retains sequence number 2 and, for v3, first row ID 1 after the concurrent commit. Linked pull request #19187 is already open against this issue.

索引モデルが issue の本文から書いたものです。

説明

bug
Apache Iceberg version

main (development)

Query engine

None

Please describe the bug 🐞

When a transaction retries after a concurrent commit, a manifest staged by an earlier operation in the transaction keeps its path, and the retry gives it a new sequence number (v2+) and first row ID (v3+) in the new manifest list. A later operation in the same transaction can still use that manifest as it was in the first attempt, because two caches are keyed by ManifestFile, which compares by path:

  • SnapshotProducer.manifestsWithMetadata returns the first attempt's ManifestFile, so the later operation's manifest list is written with its old sequence numbers and first row ID.
  • ManifestFilterManager.filteredManifests returns the first attempt's result: the old ManifestFile for a manifest it keeps, or, for one it rewrites, the filtered manifest written from the first attempt's entries.

Reproduction in core:

Transaction txn = table.newTransaction();
txn.newFastAppend().appendFile(FILE_A).commit();
txn.newFastAppend().appendFile(FILE_B).commit();

// a concurrent commit makes the transaction retry
table.newFastAppend().appendFile(FILE_C).commit();
txn.commitTransaction();

FILE_A, added by the transaction's first snapshot, should have that snapshot's data sequence number (2) and, in v3, first row ID (1). It has 1 and 0 instead: the same as FILE_C, the concurrent commit's file, whose row IDs it then overlaps.

The same happens when the later operation is a delete:

Second operation in the transaction FILE_A data sequence number (expected 2)
newFastAppend().appendFile(FILE_B) 1
newDelete().deleteFile(FILE_D), which keeps the staged manifest 1
newDelete().deleteFile(FILE_B) after appending FILE_A and FILE_B, which rewrites it 1
newAppend().appendFile(FILE_B) with manifest merging 2 (not affected)

The wrong data sequence number changes which equality and position deletes apply to FILE_A, and in v3+ its row IDs overlap those of the concurrent commit.

Found while addressing a review comment on #19027 (@timothyw553), where it also lets a RewriteManifests in such a transaction bypass the check that PR adds.

Willingness to contribute
  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
主要言語
Java
スター
9.5k
フォーク
3.7k
平均マージ
2日 2時間
マージ済み PR(30日)
170

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iceberg のほかの issue

apache/iceberg の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。