laskoviymishka opened a new pull request, #945:
URL: https://github.com/apache/iceberg-go/pull/945
Closes #830 (concurrent-writer conflict detection) — fifth and final PR in
the sequence. The retry loop in Table.doCommit now actually does something
useful for contended commits.
Before this change, doCommit's retry loop re-issued the same updates and
requirements between attempts. After a peer advanced the branch with a
non-conflicting commit, AssertRefSnapshotID deterministically failed on every
retry and the budget was wasted. The default num-retries was set to 0 in #912
precisely to avoid this slow-fail.
What changes:
- On ErrCommitFailed mid-loop, reload the catalog's current metadata via
cat.LoadTable.
- Build a fresh conflictContext with (base = writer's view, current =
freshly loaded). Validators now run against real concurrent-snapshot state —
the framework wired in #934 finally fires.
- Rewrite AssertRefSnapshotID requirements to point at the new branch head
before re-submitting. Mirrors Java's SnapshotProducer between-retry behavior.
- The pre-flight pass moved inside the loop so attempt 0 still gets a
no-op validation (base == current → empty concurrent list) without a separate
code path.
Behavior matrix after this PR (with num-retries > 0):
- Peer advance with no semantic conflict: validators pass on refresh,
requirements rewritten, retry succeeds. Was: spin to exhaustion.
- Peer advance with semantic conflict (e.g. same partition overwrite):
validators reject on refresh, retry exits terminally. Was: spin to exhaustion.
- Diverged base (branch deleted): newConflictContext returns
ErrCommitDiverged, terminal exit. Same as before.
Also tightens flakyCatalog's LoadTable to return a real Table backed by its
current metadata, so refresh paths in retry tests no longer dereference nil.
E2E tests cover the headline success path (peer advance, retry succeeds with
rewritten assertion), the terminal-on-conflict path (validator rejects on
refresh), and the rewriteRefSnapshot- Requirements helper directly.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]