Revanth14 commented on code in PR #2140:
URL: https://github.com/apache/iceberg-go/pull/2140#discussion_r4235479351
##########
table/transaction.go:
##########
@@ -2496,12 +2496,12 @@ func (t *Transaction) performCopyOnWriteDeletion(ctx
context.Context, operation
// without this check a refresh-and-replay would swap the original file
// for a rewrite built from the stale snapshot, dropping the concurrent
// deletes and resurrecting their rows. Mirrors Java's copy-on-write
- // validateNoConflictingDeletes: no isolation gating.
- removed := append(slices.Clip(filesToDelete), filesToRewrite...)
+ // validateNoConflictingDeletes: no isolation gating. A concurrent
+ // removal of one of these files is caught earlier, by the retry
+ // rebuild's checkRemovedFiles (ErrCommitDiverged).
+ removed := slices.Concat(filesToDelete, filesToRewrite)
if len(removed) > 0 {
- t.addValidator(func(cc *conflictContext) error {
- return validateNoNewDeletesForRewrittenFiles(cc,
removed)
- })
+ t.addValidator(rewriteValidator(removed))
Review Comment:
Done. The comment now names `rewriteValidator` and notes the check is shared
with `RewriteDataFiles`, so changes there apply to copy-on-write too.
--
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]