anuengineer commented on a change in pull request #1016: HDDS-1672. Improve
locking in OzoneManager.
URL: https://github.com/apache/hadoop/pull/1016#discussion_r297455815
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -144,10 +146,13 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
String bucketKey = metadataManager.getBucketKey(volumeName, bucketName);
IOException exception = null;
- metadataManager.getLock().acquireVolumeLock(volumeName);
- metadataManager.getLock().acquireBucketLock(volumeName, bucketName);
- try {
+ boolean acquiredBucketLock = false;
+ metadataManager.getLock().acquireLock(VOLUME_LOCK, volumeName);
Review comment:
nit: if acquireLock can return true , the you can write acquiredBucketLock
= acquireLock, just eliminates 2 lines of code
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]