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


##########
core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java:
##########
@@ -426,6 +434,9 @@ public Schema alterSchema(NameIdentifier ident, 
SchemaChange... changes)
                                   .build()),
                   "UPDATE",
                   schemaId);
+          // A null result is logged, and the entity may still reference the 
released secrets.
+          secretManager.commitSecrets(
+              updatedSchemaEntity == null ? preparedSecrets.withoutReleased() 
: preparedSecrets);

Review Comment:
   `operateOnEntity` catches every exception from the `store.update` call, logs 
it and returns null, so the commit below still runs and makes the new versions 
current. That matches the catalog, which already has the change: a rotation 
keeps the URN, and a new URN (a first binding or another provider) has its 
first version current as soon as it is written. Rolling back here would drop 
the new value of a rotation and leave a new URN with no value. 
`TestSchemaOperationDispatcher.testSecretAlterWhenSchemaEntityUpdateFails` 
makes `store.update` throw and checks that the rotated value is readable. I 
reworded the comment here so this is visible at the call site.



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