nssalian commented on code in PR #2302:
URL: https://github.com/apache/iceberg-go/pull/2302#discussion_r4404994849


##########
table/rewrite_data_files.go:
##########
@@ -625,6 +631,33 @@ func (t *Transaction) rewriteDataFilesPartial(ctx 
context.Context, groups []Comp
                if err != nil {
                        return result, fmt.Errorf("open table IO for partial 
rewrite batch: %w", err)
                }
+
+               // The groups were planned against the starting table, but an 
earlier
+               // batch's refresh-and-replay retry can commit on top of peer
+               // snapshots. Those snapshots then form this batch's base, so 
its
+               // commit-time validator never sees them, while its planned 
tasks lack
+               // any delete files they added. Rewriting anyway would write 
the deleted
+               // rows back and then drop those deletes as dead.
+               if err := validateNoNewDeletesSincePlanning(planned, 
current.Metadata(), t.branch, fs, batchGroups); err != nil {
+                       if !errors.Is(err, ErrConflictingDeleteFiles) {
+                               return result, fmt.Errorf("validate partial 
rewrite batch %d against its planning snapshot: %w", batchNum, err)
+                       }
+
+                       failedCommits++

Review Comment:
   Nothing pins this increment. If I replace it with `_ = failedCommits`, all 
the `TestRewrite|Compaction` tests still pass. The only `MaxFailedCommits` test 
goes through `cat.failOn`. Since the doc now says these rejections count toward 
the bound, could you add a case with `MaxFailedCommits: 1` where two batches 
get rejected, and assert the "maximum failed commits reached" error?



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