You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by bh...@apache.org on 2020/07/25 05:05:13 UTC
[hadoop-ozone] branch master updated: HDDS-4007. Generate
encryption info for the bucket outside bucket lock. (#1242)
This is an automated email from the ASF dual-hosted git repository.
bharat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git
The following commit(s) were added to refs/heads/master by this push:
new ac2769e HDDS-4007. Generate encryption info for the bucket outside bucket lock. (#1242)
ac2769e is described below
commit ac2769e5f332e8e8b279ff93148c4f1761d61340
Author: Bharat Viswanadham <bh...@apache.org>
AuthorDate: Fri Jul 24 22:04:57 2020 -0700
HDDS-4007. Generate encryption info for the bucket outside bucket lock. (#1242)
---
.../hadoop/ozone/om/request/key/OMKeyRequest.java | 40 ++++++++++++----------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
index e3f0a69..d863073 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
@@ -481,38 +481,40 @@ public abstract class OMKeyRequest extends OMClientRequest {
// If KMS is not enabled, follow the normal approach of execution of not
// reading DB in pre-execute.
+
+ OmBucketInfo bucketInfo = null;
if (ozoneManager.getKmsProvider() != null) {
try {
acquireLock = omMetadataManager.getLock().acquireReadLock(
BUCKET_LOCK, volumeName, bucketName);
-
- OmBucketInfo bucketInfo = omMetadataManager.getBucketTable().get(
+ bucketInfo = omMetadataManager.getBucketTable().get(
omMetadataManager.getBucketKey(volumeName, bucketName));
-
- // Don't throw exception of bucket not found when bucketinfo is not
- // null. If bucketinfo is null, later when request
- // is submitted and if bucket does not really exist it will fail in
- // applyTransaction step. Why we are doing this is if OM thinks it is
- // the leader, but it is not, we don't want to fail request in this
- // case. As anyway when it submits request to ratis it will fail with
- // not leader exception, and client will retry on correct leader and
- // request will be executed.
- if (bucketInfo != null) {
- Optional< FileEncryptionInfo > encryptionInfo =
- getFileEncryptionInfo(ozoneManager, bucketInfo);
- if (encryptionInfo.isPresent()) {
- newKeyArgs.setFileEncryptionInfo(
- OMPBHelper.convert(encryptionInfo.get()));
- }
- }
} finally {
if (acquireLock) {
omMetadataManager.getLock().releaseReadLock(
BUCKET_LOCK, volumeName, bucketName);
}
}
+
+ // Don't throw exception of bucket not found when bucketinfo is
+ // null. If bucketinfo is null, later when request
+ // is submitted and if bucket does not really exist it will fail in
+ // applyTransaction step. Why we are doing this is if OM thinks it is
+ // the leader, but it is not, we don't want to fail request in this
+ // case. As anyway when it submits request to ratis it will fail with
+ // not leader exception, and client will retry on correct leader and
+ // request will be executed.
+
+ if (bucketInfo != null) {
+ Optional<FileEncryptionInfo> encryptionInfo =
+ getFileEncryptionInfo(ozoneManager, bucketInfo);
+ if (encryptionInfo.isPresent()) {
+ newKeyArgs.setFileEncryptionInfo(
+ OMPBHelper.convert(encryptionInfo.get()));
+ }
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org