laskoviymishka opened a new pull request, #2699: URL: https://github.com/apache/iceberg-go/pull/2699
On a REST table loaded with `snapshot-loading-mode=refs`, `Metadata().Snapshots()` only holds the snapshots a branch or tag points at, so orphan cleanup planned the files of every other snapshot as orphans and deleted them. `planOrphanFiles`, which both `PlanOrphanFiles` and `DeleteOrphanFiles` go through, now fails before listing anything when the table has refs-only history and says to reload with `snapshot-loading-mode=all`. A real delete checks the refreshed table, because `Refresh` keeps the catalog's load mode. To let `maintenance` see the mode, this adds `Table.SnapshotHistoryLimitedToRefs`. It is part of the v0.8.0 RC blockers (item B4) and replaces #2599. New tests cover plan, dry run and delete on a refs-only table, plus a full table whose refresh comes back refs-only; they fail without the guard, and the full-history path still removes the orphan. `go build ./...`, `go vet ./...` and `go test ./table/... ./cmd/iceberg/...` pass. This is only a guard: `iceberg clean-orphan-files` against a refs-mode REST server now fails rather than loading full history. Reloading through `FullSnapshotHistoryLoader`, as #2601 does for expiration, could be a follow-up. > AI-assisted, reviewed by a human. -- 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]
