rambleraptor commented on code in PR #1283:
URL: https://github.com/apache/iceberg-go/pull/1283#discussion_r3531816794
##########
table/table.go:
##########
@@ -526,6 +526,20 @@ func (t Table) doCommit(ctx context.Context, updates
[]Update, reqs []Requiremen
}
}
+ // Inner data manifests written by superseded retry attempts (a rewrite
+ // re-merges everything on each retry) are orphaned objects: on success
the
+ // committed snapshot references only the final attempt's, and on a
failed
+ // commit nothing references any of them. They are always safe to
delete —
+ // the winning attempt's manifests are never added to this set — so
collect
+ // them on both the success and the safe-failure (exhausted
ErrCommitFailed)
+ // paths. The defer skips cleanup only on the unsafe non-ErrCommitFailed
+ // path, which already returned above with cleanupOrphans = false.
+ for _, u := range updates {
+ if su, ok := u.(*addSnapshotUpdate); ok &&
su.supersededManifests != nil {
+ orphanedManifests = append(orphanedManifests,
*su.supersededManifests...)
Review Comment:
Yep, we should handle that. (I really hate the all of the edge cases we have
to deal with for retries...)
Made that change. @laskoviymishka mentioned that too, so we're in the clear.
--
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]