You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/08/09 19:40:37 UTC
[PR] fix(table): respect gc.enabled during snapshot expiration [iceberg-go]
fallintoplace opened a new pull request, #1737:
URL: https://github.com/apache/iceberg-go/pull/1737
## Summary
`ExpireSnapshots` could remove snapshots and later garbage-collect their files even when the table property `gc.enabled=false`.
This change:
- rejects snapshot expiration when garbage collection is disabled
- applies the guard before staging metadata requirements
- keeps the behavior independent of `WithPostCommit(false)`
- exposes the shared `gc.enabled` property constant and default
- updates the cleanup documentation
The error matches the current Iceberg Java implementation: `Cannot expire snapshots: GC is disabled (deleting files may corrupt other tables)`.
## Test plan
- `go test ./... -count=1`
- `go vet ./...`
- `go test -race ./codec/... ./table/...`
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): respect gc.enabled during snapshot expiration [iceberg-go]
Posted by "fallintoplace (via GitHub)" <gi...@apache.org>.
fallintoplace closed pull request #1737: fix(table): respect gc.enabled during snapshot expiration
URL: https://github.com/apache/iceberg-go/pull/1737
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): respect gc.enabled during snapshot expiration [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #1737:
URL: https://github.com/apache/iceberg-go/pull/1737
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): respect gc.enabled during snapshot expiration [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #1737:
URL: https://github.com/apache/iceberg-go/pull/1737#discussion_r3833276195
##########
table/transaction.go:
##########
@@ -3266,6 +3269,14 @@ func (t *Transaction) Commit(ctx context.Context) (*Table, error) {
return t.tbl, nil
}
+func validateGCEnabledForSnapshotExpiration(props iceberg.Properties) error {
+ if !props.GetBool(GCEnabledKey, GCEnabledDefault) {
Review Comment:
`GetBool(..., true)` fails open here: Go's parser accepts values such as `"1"` as true, while parse errors such as `"garbage"` or `"false "` return the true default. That means malformed/non-Java values can still enable snapshot expiration and physical file deletion. Iceberg Java only enables this property for case-insensitive `"true"`. Please make this safety gate fail closed or exactly match Java parsing, use the same helper for post-commit cleanup and `PurgeFiles`, and add tests for these values.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org