ChenSammi commented on code in PR #8360:
URL: https://github.com/apache/ozone/pull/8360#discussion_r2074873613
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java:
##########
@@ -236,6 +243,10 @@ public void create(VolumeSet volumeSet,
VolumeChoosingPolicy
"Failed to create " + containerData + " on all volumes: " +
volumeSet.getVolumesList(),
ex, CONTAINER_INTERNAL_ERROR);
}
+ } finally {
+ if (exceptionThrown) {
+ containerData.releaseCommitSpace();
+ }
Review Comment:
Right. We can change exceptionThrown to something like "creationSuccess"
with default value false, and change the value to true to replace L212. and
use the following in finally.
if (creationSuccess) {
// commit space has been reserved by volumeChoosingPolicy
containerData.setCommittedSpace(true);
}
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]