badalprasadsingh opened a new issue, #2609:
URL: https://github.com/apache/iceberg-go/issues/2609

   ### Apache Iceberg version
   
   main (development)
   
   ### Please describe the bug 🐞
   
   `UpdateSchema` sends only `AssertCurrentSchemaID` as its commit requirement 
-> it does not check that "last-column-id" is unchanged, which iceberg-ava's 
`UpdateRequirements` does with `AssertLastAssignedFieldId`. So a writer with an 
old table handle can add a column using a field ID another writer already used, 
and with the default retries (4 since #2462) the commit goes through.
   
   what I mean is: with two writers on one table (SQL catalog):
   
   1. writer A loads the table (`id long`, `last-column-id` 1)
   2. writer B adds `y long` (field ID 2), appends a row `(id 1, y 42)`, then 
drops `y`. The current schema id goes back to 0, and `last-column-id` is 2
   3. writer A, still on its old handle, adds `x long` and commits
   4. A's commit succeeds, and `x` gets field ID 2
   5. scanning `id, x` returns `x = 42` for row 1, expected `null` (42 is B's 
dropped `y` value)
   
   With `commit.retry.num-retries=0` (the default before #2462), step 3 fails 
with `requirement failed: branch "main" was created concurrently`. With the 
default retries, the retry rebases the branch check and replays A's stale 
`AddSchema`, because `AssertCurrentSchemaID(0)` is still true.
   
   The spec says `last-column-id` exists "to ensure columns are always assigned 
an unused ID when evolving schemas."
   


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