LuciferYang commented on code in PR #14983:
URL: https://github.com/apache/gravitino/pull/14983#discussion_r4597452428


##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -2356,8 +2358,8 @@ private void updateCatalogProperty(
    * removes the catalog entity left behind by a failed publication.
    */
   private void rollbackFailedCatalogCreate(
-      NameIdentifier ident, List<SecretMaterial> secretMaterials, boolean 
entityStored) {
-    secretManager.rollbackSecrets(secretMaterials);
+      NameIdentifier ident, SecretVersionChanges stagedSecrets, boolean 
entityStored) {
+    secretManager.rollbackSecrets(stagedSecrets);

Review Comment:
   Thanks, fixed in 4d1d95f0a. `rollbackFailedCatalogCreate` now deletes the 
stored entity first and rolls the secrets back only after that delete succeeds. 
If the delete fails, it keeps the secrets and throws a 
`GravitinoRuntimeException` saying the catalog was left behind and should be 
dropped with force, with the original failure as the cause and the delete 
failure suppressed. After `store.put`, what can still fail inside the rollback 
scope is publishing to the cache and releasing the catalog lease, so the new 
test `testFailureAfterCatalogIsStoredKeepsSecretsUntilEntityIsRemoved` fails 
the lease release, with and without a failing delete.
   



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