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

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   Found by a systematic test of the Iceberg REST server (Iceberg 1.11.0, JDBC 
backend, authorization enabled). Some requests are applied and then reported as 
failed, and some table updates are applied without checks and leave a table 
clients cannot write or load:
   
   1. Creating a namespace with a level containing `.` returns 400 but creates 
a nested namespace with no owner (the JDBC backend stores `a.b` as `["a","b"]`).
   2. Creating a namespace whose full name is longer than 128 characters 
returns 500 but creates it, with no Gravitino entity or owner.
   3. Creating a table with a column type Gravitino cannot import (for example 
`variant`) returns 406 or 400 but creates the table, with no Gravitino entity 
or owner.
   4. Register with `overwrite: true` and metadata of a different table returns 
500 "Table UUID does not match" after replacing the table.
   5. A create or commit with a partition field that omits the optional 
`field-id` returns 500 after being applied (building the event copy fails).
   6. `set-snapshot-ref` can turn `main` into a tag; every later write fails.
   7. `add-snapshot` accepts an unknown `operation`, a missing summary on a v2 
table, or an unknown `schema-id`; pyiceberg then cannot load the table.
   8. `remove-snapshots` silently deletes every branch or tag that references 
the removed snapshot, including `main`. An expire racing a tag or rollback 
loses the ref, or empties the table.
   
   ### Error message and/or stacktrace
   
   `500 {"type":"RuntimeException","message":"Failed to import schema entity to 
the store"}`, `500 {"type":"IllegalStateException","message":"Table UUID does 
not match: current=... != refreshed=..."}`, and the 200 responses for items 6 
to 8.
   
   ### How to reproduce
   
   - `POST /v1/{prefix}/namespaces` with `{"namespace":["n.dot"]}`, then load 
`["n","dot"]`.
   - `POST /v1/{prefix}/namespaces/{ns}/tables/{t}` with 
`{"requirements":[],"updates":[{"action":"set-snapshot-ref","ref-name":"main","type":"tag","snapshot-id":S}]}`,
 then insert from Spark.
   - `POST /v1/{prefix}/namespaces/{ns}/tables/{t}` with 
`{"requirements":[],"updates":[{"action":"remove-snapshots","snapshot-ids":[CURRENT]}]}`,
 then read the table.
   
   ### Additional context
   
   A request that fails should leave nothing behind, and a commit that would 
leave the table unusable should be refused.


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