markhoerth opened a new issue, #14465:
URL: https://github.com/apache/gravitino/issues/14465

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   1. When `DELETE /v1/{prefix}/namespaces/{ns}` and `POST 
/v1/{prefix}/namespaces/{ns}/tables` on the same empty namespace overlap, both 
can succeed. The namespace survives because it now holds the table, but it 
loses every property, including `owner`, and its Gravitino schema loses its 
owner. `IcebergNamespaceHookDispatcher.dropNamespace` holds a write tree lock 
on the namespace's top-level branch; `IcebergTableHookDispatcher.createTable` 
takes no lock.
   2. `DELETE .../tables/{table}?purgeRequested=true` on a table where a 
snapshot's manifest list is missing returns 500 with the raw storage SDK 
message after the table has been dropped, and deletes no files. A retry gets 
404, so no request is left that deletes the files. Iceberg's 
`JdbcCatalog.dropTable` removes the catalog row first, and 
`CatalogUtil.dropTableData` then stops at the first file it cannot read.
   
   ### Error message and/or stacktrace
   
   ```
   DELETE /v1/cat/namespaces/ns  204   (concurrently)  POST 
/v1/cat/namespaces/ns/tables  200
   DELETE /v1/cat/namespaces/ns/tables/t?purgeRequested=true  500 
NoSuchKeyException ... (table gone, 0 files deleted)
   ```
   
   ### How to reproduce
   
   1. Repeatedly create an empty namespace, then drop it and create a table in 
it concurrently: in some rounds both return success.
   2. Append to a table twice, delete the first snapshot's manifest list from 
storage, then purge the table.
   
   ### Additional context
   
   Serialized either way, one of the two requests in (1) must fail. A purge 
should delete everything it can still reach.


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

Reply via email to