Repository navigation
SS-148 Iceberg sink, don't attempt commit unless it's definitely not a duplicate - #38441
Conversation
QA LLM Review1. MEDIUM -- Pre-commit guard only rejects an exactly-equal frontier, so a writer that committed a strict prefix of our batch still produces duplicate rows
The new guard proves "not a duplicate" only when DetailsThe reachable window is a sink version handoff, which is a normal
Suggested fix, after the two existing fatal arms: if last_frontier != *batch_lower {
// Another writer committed inside our batch range. Committing now would
// duplicate [batch_lower, last_frontier). Restart and re-resume instead.
return (
table,
RetryResult::FatalErr(anyhow!(
"Iceberg table '{}' advanced to frontier {:?} inside batch [{}, {}); \
another writer is active.",
conn_table,
last_frontier,
batch_lower.pretty(),
batch_upper.pretty(),
)),
);
}2. MEDIUM --
|
There was a problem hiding this comment.
I think just fix this main issue and it looks ok? Would also take a look at the test setup issue in the LLM review but that's less important to me.
Merge issues probably just from my iceberg stuff last week, should be pretty easy although you'll need to rebase your iceberg-rust changes and update the revision
a8c31ac to
857ba87
Compare
QA LLM Review1. MEDIUM -- Hand-rolled commit drops iceberg-rust's guard against committing to an encrypted table
DetailsThe guard is in Reachable shape: a table pre-created in the catalog with Before this change Best fixed by rejecting the table up front rather than at commit time: check |
Claude: on both retrial paths, check for other writers
503a993 to
34cc35f
Compare
|
added a lil formatting fix for the broken testdrive from #38732 |
replaces #38333
We rely on MaterializeInc/iceberg-rust#7 making the Transaction commit internals public.
Then we reimplement Transaction commit, but without the built-in rebase+retry.
Previously,
iceberg-rustloaded the table from the Catalog on every commit attempt, applying the transaction's actions on top of the latest state of the table.With this PR, Mz loads the table from the Catalog on every commit attempt, but it does not apply the transaction's action on top of the latest state of the table until after it inspects the table state (for funny business like a previously successful attempt or another writer taking over).