dhananjaykrutika opened a new pull request, #716:
URL: https://github.com/apache/iceberg-go/pull/716

   Snapshot expiration maintenance can race with concurrent client commits that 
reference the same snapshot being expired. Consider:
   
   1. Maintenance identifies snap-1 as expired and eligible for removal
   2. Client commits AddSnapshotRef linking snap-1 to "feature-branch"
   3. Maintenance loads metadata (now contains feature-branch → snap-1)
   4. Maintenance commits RemoveSnapshot for snap-1
   
   The CAS succeeds because maintenance has the latest pointer, but the 
resulting metadata is corrupt: feature-branch references a deleted snapshot.
   
   CAS only guarantees the pointer hasn't changed since we read it - it does 
not validate that our operation is semantically correct against the current 
state. By checking isSnapshotReferenced() against the freshly loaded metadata, 
we detect that snap-1 is now in use and skip its removal. The CAS then 
guarantees this validated state remains current through the commit.


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