sodonnel commented on code in PR #3992:
URL: https://github.com/apache/ozone/pull/3992#discussion_r1029838091
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketSetPropertyRequest.java:
##########
@@ -153,6 +153,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager
ozoneManager,
.setBucketName(dbBucketInfo.getBucketName())
.setObjectID(dbBucketInfo.getObjectID())
.setBucketLayout(dbBucketInfo.getBucketLayout())
+ .setBucketEncryptionKey(dbBucketInfo.getEncryptionKeyInfo())
Review Comment:
Could you add a test to reproduce the issue and prove the fix in
TestOMBucketSetPropertyRequest?
The code in this class is very prone to this sort of problem. I feel we need
a method on `OmBucketInfo.Builder` that takes an existing OMBucketInfo (in this
case dbBucketInfo), and sets all the fields to those in the passed in object.
Then we know we have copied everything from the DB object to the new one.
Then we can go ahead and override anything passed in that is to be change. That
is a reasonable refactor though, so not something we have to do here now.
--
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]