xiaoyuyao commented on a change in pull request #1497:
URL: https://github.com/apache/ozone/pull/1497#discussion_r513750621



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -459,7 +459,7 @@ public OpenKeySession openKey(OmKeyArgs args) throws 
IOException {
         args.getVolumeName(), args.getBucketName(), args.getKeyName());
 
     FileEncryptionInfo encInfo;
-    metadataManager.getLock().acquireWriteLock(BUCKET_LOCK, volumeName,
+    metadataManager.getLock().acquireReadLock(BUCKET_LOCK, volumeName,

Review comment:
       This needs a WriteLock.

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/S3SecretManagerImpl.java
##########
@@ -61,7 +61,7 @@ public S3SecretValue getS3Secret(String kerberosID) throws 
IOException {
     Preconditions.checkArgument(Strings.isNotBlank(kerberosID),
         "kerberosID cannot be null or empty.");
     S3SecretValue result = null;
-    omMetadataManager.getLock().acquireWriteLock(S3_SECRET_LOCK, kerberosID);
+    omMetadataManager.getLock().acquireReadLock(S3_SECRET_LOCK, kerberosID);

Review comment:
       This should be a WriteLock.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to