Skip to content

Add SkipIfReferenced flag to removeSnapshotsUpdate#722

Open
dhananjaykrutika wants to merge 1 commit intoapache:mainfrom
dhananjaykrutika:remove-snapshot-flag
Open

Add SkipIfReferenced flag to removeSnapshotsUpdate#722
dhananjaykrutika wants to merge 1 commit intoapache:mainfrom
dhananjaykrutika:remove-snapshot-flag

Conversation

@dhananjaykrutika
Copy link
Contributor

ExpireSnapshots computes candidate snapshots for deletion at time T1, but by the time CommitTable applies the update at T2, a concurrent client might link one of these snapshots to a new branch or tag. Without protection, the snapshot is deleted and its new ref is silently cleaned up.

This change adds a SkipIfReferenced flag to removeSnapshotsUpdate. When set, Apply() filters out any snapshot that is still referenced before calling RemoveSnapshots(). ExpireSnapshots sets this flag via SetSkipIfReferenced().

The default behavior (SkipIfReferenced=false) is unchanged: snapshots are removed and orphaned refs are silently cleaned up, preserving backward compatibility with explicit client-driven remove-snapshot updates.

ExpireSnapshots computes candidate snapshots for deletion at time T1,
but by the time CommitTable applies the update at T2, a concurrent
client might link one of these snapshots to a new branch or tag.
Without protection, the snapshot is deleted and its new ref is silently
cleaned up.

This change adds a SkipIfReferenced flag to removeSnapshotsUpdate.
When set, Apply() filters out any snapshot that is still referenced
before calling RemoveSnapshots(). ExpireSnapshots sets this flag
via SetSkipIfReferenced().

The default behavior (SkipIfReferenced=false) is unchanged: snapshots
are removed and orphaned refs are silently cleaned up, preserving
backward compatibility with explicit client-driven remove-snapshot
updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant