roryqi opened a new pull request, #14530: URL: https://github.com/apache/gravitino/pull/14530
### What changes were proposed in this pull request? Carry forward #14439 onto the latest `main`, preserving the original author's commit and both conflicting tests in `TestIcebergRESTUtils`. - Validate namespace names, registration UUIDs, snapshots, and refs before committing. Check the metadata built in memory on each retry so adding a schema or resetting a ref cannot bypass validation. - Validate staged creates while preserving Iceberg's allowed existence requirement, and apply UUID checks through the REST registration overload. - Remove automatic table/namespace deletion on import failure. Unexpected import errors propagate without deleting catalog objects. - Keep event-copy failures from failing completed requests. ### Why are the changes needed? Invalid commits can leave unusable table metadata or silently remove refs. Deleting objects after a failed import can race with other clients. This supersedes the conflicting #14439 with checks before commit instead of deletion after failure. Fixes #14438 ### Does this PR introduce _any_ user-facing change? Yes. Invalid changes are rejected with 400, or 409 when removing a referenced snapshot. Import failures no longer trigger automatic deletion. ### How was this patch tested? - `./gradlew :iceberg:iceberg-rest-server:spotlessApply :iceberg:iceberg-rest-server:test -PskipITs` - Full module run: 514 tests passed. After the final conflict-response change, all 11 `TestIcebergCommitValidation` tests passed with `--tests org.apache.gravitino.iceberg.service.TestIcebergCommitValidation`. - Regression tests cover staged-create success/rejection, actual schema-id assignment, refs still pointing at removed snapshots, both credential-vending flags during registration, and no deletion on import failure. - `git diff --check` -- 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]
