hcrosse opened a new pull request, #2468:
URL: https://github.com/apache/iceberg-go/pull/2468

   ## What
   
   This is the `stagedReplay` follow-up to 
https://github.com/apache/iceberg-go/pull/2354.
   
   Every retry and resumed `Commit` now replays staged updates in order through 
`stagedReplay`, and `rebuildSnapshotUpdates` is deleted. On `main`, an append 
staged after `RollbackToSnapshot` and retried after a peer commit on another 
branch committed with the rollback silently undone. It now stays on the 
rollback target.
   
   If a staged update cannot apply after refresh, the transaction ends with 
`ErrTransactionUnusable`. This now holds for every transaction, not only those 
with an expiry. The original cause remains, so conflicts also match 
`ErrCommitFailed`. A catalog rejection on the first attempt still returns 
`ErrCommitRejected` and leaves the transaction resumable. A later `Commit` ends 
the transaction only if replay cannot apply the staged update.
   
   Replayed producer snapshots get `max(now, parent + 1ms)` timestamps, 
following Java's `SnapshotProducer`. This avoids rejection when the staging 
timestamp is more than a minute older than refreshed metadata.
   
   When `ExpireSnapshots` is staged after a write in the same transaction, a 
retry replans the expiry against the refreshed table. The write's renewed 
snapshot is newer than the cutoff, so it survives. Java instead expires the 
snapshot its first attempt selected.
   
   https://github.com/apache/iceberg-go/pull/2384's tests pass on this branch 
without its engine change.
   
   I can pass the replay directly to `doCommit` instead of through 
`withCommitReplay`.
   
   I can move `stagedReplay` out of `expire_replay.go` into its own file.
   
   ## Testing
   
   `TestRefreshReplayKeepsRollbackBeforeAppend`, 
`TestRefreshReplayKeepsCountersAcrossStagedRollback`, 
`TestRefreshReplayRenewsTimestampsOnRebuild`, 
`TestRefreshReplayRenewsTimestampOnReuse`, 
`TestExpireReplayRenewsStagedSnapshotTimestamp` and 
`TestRefreshReplayApplyFailureKeepsConflictCause` fail on `main`.
   
   Formatting, vet, table, catalog and CLI tests, race tests, lint and API 
compatibility checks passed.
   


-- 
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]

Reply via email to