laskoviymishka commented on code in PR #2599:
URL: https://github.com/apache/iceberg-go/pull/2599#discussion_r4639969956


##########
table/table.go:
##########
@@ -209,6 +209,12 @@ func (t Table) Location() string                     { 
return t.metadata.Locatio
 func (t Table) CurrentSnapshot() *Snapshot           { return 
t.metadata.CurrentSnapshot() }
 func (t Table) SnapshotByID(id int64) *Snapshot      { return 
t.metadata.SnapshotByID(id) }
 func (t Table) SnapshotByName(name string) *Snapshot { return 
t.metadata.SnapshotByName(name) }
+
+// SnapshotHistoryLimitedToRefs reports whether this table was loaded with only
+// snapshots directly referenced by branches and tags. Operations that depend
+// on complete snapshot history must not use a table when this returns true.
+func (t Table) SnapshotHistoryLimitedToRefs() bool { return 
t.snapshotHistoryRefsOnly }

Review Comment:
   Should `ExpireSnapshots` get the same guard, here or in a follow-up issue? 
This doc says operations that need complete history must not use such a table, 
and expiry is one of them. It isn't new: `main` already computes retention over 
the loaded snapshots only 
([transaction.go](https://github.com/apache/iceberg-go/blob/00f68a85079100265953b18a65496b87c0b78843/table/transaction.go#L941-L974)),
 so with `max-ref-age-ms` set it can expire a ref's head that 
`min-snapshots-to-keep` would keep under full history. In a repro on an earlier 
revision of this PR (`transaction.go` is unchanged since), full-history expiry 
kept that snapshot, refs-only expiry committed its removal, and the hidden 
snapshot's files stayed on disk.



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