Problem
ReadBridgeStripProtection.isRewrite treats a commit as a rewrite only if the main-branch snapshot (or a replace/RTAS flag) is overwrite/replace.
The snapshots PUT sends the table's full snapshot list and ref map. Main-only is how we avoid treating a historical overwrite still in that list as "this commit." Side effect: a WAP / named-branch overwrite leaves main on an old append, so Type 2 does not fire. An unaware client can overwrite a stamped table on a branch without sending initial-default.
Do not
Do not infer the written ref by diffing existing vs incoming snapshot-ref maps. That re-derives what the commit already knew and fails on create-branch-at-same-snapshot, tags, and multi-ref PUTs.
Do
#669 adds optional jsonMetadataUpdates on IcebergSnapshotsRequestBody: Iceberg REST TableUpdate deltas (add-snapshot, set-snapshot-ref) from TableMetadata.changes().
After #669 (or equivalent) lands:
- Plumb those deltas to the write path that calls
ReadBridgeStripProtection.prepare (today they are audit-only).
- Type 2: if an
add-snapshot in this commit is overwrite/replace, require a matching initial-default handshake. Use set-snapshot-ref for which branch was written (main, WAP, …).
CREATE BRANCH with only set-snapshot-ref and no new snapshot is not a rewrite.
- Clients that omit
jsonMetadataUpdates keep the current main-only fallback.
Depends on #669. Blocks closing the WAP gap called out on #678.
Problem
ReadBridgeStripProtection.isRewritetreats a commit as a rewrite only if the main-branch snapshot (or a replace/RTAS flag) is overwrite/replace.The snapshots PUT sends the table's full snapshot list and ref map. Main-only is how we avoid treating a historical overwrite still in that list as "this commit." Side effect: a WAP / named-branch overwrite leaves
mainon an old append, so Type 2 does not fire. An unaware client can overwrite a stamped table on a branch without sendinginitial-default.Do not
Do not infer the written ref by diffing
existingvsincomingsnapshot-ref maps. That re-derives what the commit already knew and fails on create-branch-at-same-snapshot, tags, and multi-ref PUTs.Do
#669 adds optional
jsonMetadataUpdatesonIcebergSnapshotsRequestBody: Iceberg RESTTableUpdatedeltas (add-snapshot,set-snapshot-ref) fromTableMetadata.changes().After #669 (or equivalent) lands:
ReadBridgeStripProtection.prepare(today they are audit-only).add-snapshotin this commit is overwrite/replace, require a matchinginitial-defaulthandshake. Useset-snapshot-reffor which branch was written (main, WAP, …).CREATE BRANCHwith onlyset-snapshot-refand no new snapshot is not a rewrite.jsonMetadataUpdateskeep the current main-only fallback.Depends on #669. Blocks closing the WAP gap called out on #678.