pythaac opened a new pull request, #10293:
URL: https://github.com/apache/gravitino/pull/10293
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
In `createCatalog()`, when post-hook operations fail, Gravitino attempts to
roll back by calling `dropCatalog()`.
- Before this change, if the rollback also failed, the rollback exception
masked the original post-hook exception.
- After this change, the original post-hook exception is rethrown, and the
rollback exception is attached as a suppressed exception.
### Why are the changes needed?
The previous behavior could hide the root cause (post-hook failure), making
debugging difficult.
Fix: #10217
### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
Added unit tests in `TestCatalogHookDispatcher`:
1. Verify that the original post-hook exception is thrown when rollback
succeeds.
2. Verify that the original post-hook exception is still thrown and the
rollback exception is attached as suppressed when rollback fails.
--
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]