babumahesh opened a new pull request, #10676:
URL: https://github.com/apache/gravitino/pull/10676
### What changes were proposed in this pull request?
Centralizes schema persistence error messages and adds automatic rollback
functionality when schema metadata fails to
persist to Gravitino's store after successful creation in the underlying
catalog. The changes include:
1. Added centralized error message constants in
OperationDispatcher.FormattedErrorMessages for schema persistence failures
2. Implemented rollbackEntityCreation() method to automatically delete the
schema from the underlying catalog when
Gravitino store persistence fails
3. Enhanced SchemaOperationDispatcher.createSchema() to attempt rollback
on store failures and throw appropriate exceptions
based on rollback outcome
### Why are the changes needed?
When a schema is successfully created in the underlying catalog but fails
to persist to Gravitino's metadata store (e.g.,
due to network issues, storage failures), it creates an inconsistency
where the schema exists in the catalog but not in
Gravitino's records. This leads to:
- Orphaned resources that Gravitino cannot manage
- Confusing state where subsequent operations may fail unexpectedly
The automatic rollback mechanism ensures consistency between the
underlying catalog and Gravitino's metadata store,
preventing orphaned resources and maintaining system integrity.
### How was this patch tested?
New unit tests in TestSchemaOperationDispatcher verify successful rollbacks
and rollback failures that retain the original
error reason back to callers.
Additionally, on the UI, an error message popup is displayed when failures
occur.
<img width="2536" height="1353" alt="Screenshot From 2026-04-05 00-49-11"
src="https://github.com/user-attachments/assets/65b680f1-95b7-44a1-aeef-ca020d3c3549"
/>
Fix: #10656
--
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]