bharatviswa504 commented on a change in pull request #949: HDDS-1672. Improve
locking in OzoneManager.
URL: https://github.com/apache/hadoop/pull/949#discussion_r295947682
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/S3BucketManagerImpl.java
##########
@@ -101,34 +101,26 @@ public void createS3Bucket(String userName, String
bucketName)
// anonymous access to bucket where the user name is absent.
String ozoneVolumeName = formatOzoneVolumeName(userName);
- omMetadataManager.getLock().acquireS3Lock(bucketName);
- try {
- String bucket =
- omMetadataManager.getS3Table().get(bucketName);
-
- if (bucket != null) {
- LOG.debug("Bucket already exists. {}", bucketName);
- throw new OMException(
- "Unable to create S3 bucket. " + bucketName + " already exists.",
- OMException.ResultCodes.S3_BUCKET_ALREADY_EXISTS);
- }
- String ozoneBucketName = bucketName;
- createOzoneBucket(ozoneVolumeName, ozoneBucketName);
- String finalName = String.format("%s/%s", ozoneVolumeName,
- ozoneBucketName);
+ String bucket = omMetadataManager.getS3Table().get(bucketName);
- omMetadataManager.getS3Table().put(bucketName, finalName);
- } finally {
- omMetadataManager.getLock().releaseS3Lock(bucketName);
Review comment:
Do you mean s3 bucket lock, as we need to acquire that before creating
volume. So, that is acquired in caller in OzoneManager.
----------------------------------------------------------------
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]