Repository navigation
Conversation
| use crate::{Error, ErrorKind}; | ||
|
|
||
| /// Retry-persistent state for an action that appends data files in a single | ||
| /// new manifest. |
There was a problem hiding this comment.
I don't think this is accurate, there can be multiple new manifests if the manifest is too large(rolling), or there are files from different partition spec (grouping).
Looks like currently we don't support the above mechanism in rust? Will need to double check
There was a problem hiding this comment.
the rolling mechanism can be added later, and I'm more concerned about the spec id grouping.
Looks like we just assume all new data files belong to the same partition spec (current default spec):
I think we can fix it, rather than just blocking them in the validation: https://github.com/apache/iceberg-rust/blame/main/crates/iceberg/src/transaction/snapshot.rs#L155-L164
|
cc @JanKaul |
blackmwk
left a comment
There was a problem hiding this comment.
Requesting changes for the stale inherited sequence numbers described inline. All 104 existing transaction tests pass, but a focused manifest-reuse regression test returns sequence number 35 from the cache while a fresh read correctly returns 36. Including the inherited sequence number in the manifest cache key makes that test pass.
laskoviymishka
left a comment
There was a problem hiding this comment.
This needs some work, but it's close. Keeping the commit UUID and snapshot id fixed across attempts is the right direction for #3266. Two things need to land first. One is @blackmwk's cache-key fix (+1 to that thread). The other is a reuse check in added_manifests that covers the files and spec its manifest was written from. Today that check relies on the caller passing the same files and on the default-spec check that #3500 will remove.
blackmwk
left a comment
There was a problem hiding this comment.
Re-reviewed at 4f597f1. The expanded manifest cache key fixes my previous finding: the original warmed-cache/rebase reproduction now passes. The new v3 rebase test also covers moving the snapshot's row range after a concurrent append.
Validation: all 105 transaction tests, all 6 object-cache tests, and the original regression reproduction pass. I found no remaining blocking correctness issue. One non-blocking wording correction is noted inline.
| ) -> Result<()> { | ||
| let metadata = table.metadata(); | ||
| for data_file in data_files { | ||
| if data_file.content_type() != DataContentType::Data { |
There was a problem hiding this comment.
This should only do once.
There was a problem hiding this comment.
Currently I'm copying the existing logic. How about revisiting this in #3500? These logic can be refactored and optimized at one go
There was a problem hiding this comment.
We can move every validation that does NOT depend on the current table to actions themselves
| state: &mut SimpleSnapshotProducer, | ||
| table: &Table, | ||
| ) -> Result<ActionCommit> { | ||
| self.validate()?; |
There was a problem hiding this comment.
This technically still runs every attempt, we can fix it by having a gate like if attemp <=0 then validate but I think that would be hacky and doesn't add a lot of value
Which issue does this PR close?
SimpleSnapshotProducer, migrateFastAppendAction, remove the attempt-scopedSnapshotProducerand hook traits #3418 (milestone 2 of [EPIC] Stateful transactions and snapshot production (RFC-0003) #3266)What changes are included in this PR?
Replaces the attempt-scoped
SnapshotProducerand its hook traits with:snapshot_helpers.rs: stateless functions for snapshot production (ids, paths, manifest writer, summary, manifest list + snapshot assembly). Shared withMergingSnapshotProducerlater.SimpleSnapshotProducer: retry-persistent state forFastAppendAction. Commit UUID and snapshot id are fixed across attempts, the added manifest is reused when schema and format version are unchanged, and each attempt writes its own manifest list. Previously every retry generated a new UUID and rewrote the manifest, orphaning the old one.Are these changes tested?
Unit tests for manifest reuse across attempts and invalidation on schema/format change, plus a transaction-level test where a concurrent commit forces a rebase and the manifest is reused.
AI Disclosure
Used claude for the code, vetted by human eyes with a pair of glasses