sodonnel commented on code in PR #6385:
URL: https://github.com/apache/ozone/pull/6385#discussion_r1535297523
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -775,10 +775,19 @@ protected OmKeyInfo prepareFileInfo(
dbKeyInfo.setReplicationConfig(replicationConfig);
// Construct a new metadata map from KeyArgs.
- // Clear the old one when the key is overwritten.
- dbKeyInfo.getMetadata().clear();
- dbKeyInfo.getMetadata().putAll(KeyValueUtil.getFromProtobuf(
- keyArgs.getMetadataList()));
+ // Clear the old one when the key is overwritten unless it is a key
overwrite
+ // using optimistic commit.
+ if (!keyArgs.hasOverwriteUpdateID()) {
+ dbKeyInfo.getMetadata().clear();
+ dbKeyInfo.getMetadata().putAll(KeyValueUtil.getFromProtobuf(
+ keyArgs.getMetadataList()));
+ }
+ if (keyArgs.hasOverwriteObjectID()) {
+ dbKeyInfo.setOverwriteObjectID(keyArgs.getOverwriteObjectID());
+ }
+ if (keyArgs.hasOverwriteUpdateID()) {
+ dbKeyInfo.setOverwriteUpdateID(keyArgs.getOverwriteUpdateID());
+ }
Review Comment:
I will check about the ACLs. However I am pretty sure the ACLs and all other
meta data is automatically copied from the original key, as the "openKey" entry
it take from the original closedKey entry. I will double check on that.
--
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]