CTTY commented on code in PR #1451: URL: https://github.com/apache/iceberg-rust/pull/1451#discussion_r2155068696
########## crates/iceberg/src/transaction/mod.rs: ########## @@ -129,8 +124,10 @@ impl Transaction { } }; let mut snapshot_id = generate_random_id(); + + // todo revisit this, this check won't be 100% valid because it's not checking the staging table while self - .current_table + .table .metadata() .snapshots() .any(|s| s.snapshot_id() == snapshot_id) Review Comment: Maybe we should move the generation of `snapshot_id` to `SnapshotProducer::new`. The catch of doing this: if retry happens, every attemp will have a different `snapshot_id`. I have not seen any side effects yet ########## crates/iceberg/src/transaction/mod.rs: ########## @@ -129,8 +124,10 @@ impl Transaction { } }; let mut snapshot_id = generate_random_id(); + + // todo revisit this, this check won't be 100% valid because it's not checking the staging table while self - .current_table + .table .metadata() .snapshots() .any(|s| s.snapshot_id() == snapshot_id) Review Comment: Maybe we should move the generation of `snapshot_id` to `SnapshotProducer::new`. The catch of doing this: if retry happens, every attempt will have a different `snapshot_id`. I have not seen any side effects yet -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org