Core: A retried transaction commits staged manifests with the sequence number and first row ID of the first attempt
Maintainers usually reply within 1 day
@shivadarshan-devadiga is already working on this.
Since Nov 29, 2026.
- #19187 by @shivadarshan-devadiga — open
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.manifestsWithMetadatareturns the first attempt'sManifestFile, so the later operation's manifest list is written with its old sequence numbers and first row ID.ManifestFilterManager.filteredManifestsreturns the first attempt's result: the oldManifestFilefor 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
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 3.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 170
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Spark: Test INSERT targets with computed IDENTIFIER expressionsPossibly taken @shivadarshan-devadiga claimed this 15 days ago. Openimprovement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scanPossibly taken @Ankitkj1999 claimed this 17 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tablesPossibly taken @yusufyildiz34 claimed this 37 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg#18632 · 1 comment ·
Maintainers usually reply within 1 day
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListPossibly taken @mohamed-elbrik claimed this 42 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
HexaHexes/neoforge-mod-template#124 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenLiberty/open-liberty#36410 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
erkamyaman/rust-anything#1153 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Card-Forge/forge#13173 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day