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

   ### Description
   
   Fixes #1827 
   
   Resolves the branch the same way `AssertRefSnapshotID` already does 
(`t.branch`, default `main`), looks up that branch's own head from its own ref, 
and writes the ancestor check, the ref update, and the CAS assertion to it.
   
   Also made sure:
   
   - **Unknown branch fails, never falls back to main:** 
`currentSnapshotForRef`, from #1637, intentionally falls back to main for a new 
branch — reusing it here would let rolling back a nonexistent branch silently 
rewind main, reintroducing this exact bug.
   - **Ref type is re-checked at the operation:** not only at transaction 
construction. Before this fix `RollbackToSnapshot` always wrote to 
`MainBranch`, a branch by construction, so no type check was needed. Resolving 
an arbitrary named ref makes rewriting a tag as a branch (and dropping its tag 
retention) newly reachable.
   
   ### Testing
   
   Added tests covering the relevant edge cases.


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