Fokko opened a new issue, #4538:
URL: https://github.com/apache/iceberg-python/issues/4538

   Since #4522, removing a property key that isn't set no longer raises 
`KeyError`, which matches Java. But when none of the keys exist, 
`RemovePropertiesUpdate` still calls `context.add_update(update)`. 
`update_table_metadata` then sees a change and bumps `last_updated_ms`.
   
   The Hive, Glue and SQL catalogs skip the commit when the staged metadata 
equals the current metadata (`hive.py:598`, `glue.py:709`, `sql.py:513`). The 
bumped `last_updated_ms` defeats that check. So a repeated 
`remove_properties("a")`, or one that loses a race to a concurrent removal, 
writes a new metadata JSON, adds a metadata-log entry and swaps the catalog 
pointer for a commit that changes nothing.
   
   **Proposed fix:**
   - Only record the update when at least one key was removed, the same way the 
`SetPropertiesUpdate` and `UpgradeFormatVersionUpdate` handlers return early.
   - Update the unit test added in #4522 (`tests/table/test_init.py`). It 
currently asserts that `last_updated_ms` is bumped; it should assert that the 
metadata is unchanged.
   - Add the concurrent-removal test to `tests/integration/test_catalog.py` so 
it runs against every catalog, including Hive and REST. Today it's only in 
`tests/catalog/test_catalog_behaviors.py`, which covers just InMemory and SQL. 
Glue isn't in the integration suite, so it would still need a moto-based case 
in `tests/catalog/test_glue.py`.
   


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