jiwen624 commented on code in PR #18812:
URL: https://github.com/apache/iceberg/pull/18812#discussion_r4533869412


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########


Review Comment:
   Nice catch on the bug. One remaining issue to flag here: `removeSchemas` 
doesn't remove the ID from `schemasById` (so `schemasById` becomes stale), so 
if the same commit removes the highest-ID schema and then adds a new one, the 
new schema gets the freed ID and `addSchemaInternal` skips the add because the 
stale map entry exists. This leads to metadata corruption when it's set current.
   
   The specs seem to have the same issue - which may be a follow-up.



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