smengcl commented on code in PR #6046:
URL: https://github.com/apache/ozone/pull/6046#discussion_r1470209326
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -260,15 +260,22 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager, TermIn
" metadata while recovery flag is not set in request",
KEY_UNDER_LEASE_RECOVERY);
}
}
- omKeyInfo.getMetadata().putAll(KeyValueUtil.getFromProtobuf(
- commitKeyArgs.getMetadataList()));
+
+ // non-null indicates it is necessary to update the open key
+ OmKeyInfo newOpenKeyInfo = null;
if (isHSync) {
- omKeyInfo.getMetadata().put(OzoneConsts.HSYNC_CLIENT_ID,
clientIdString);
+ if (!OmKeyHSyncUtil.isHSyncedPreviously(omKeyInfo, clientIdString,
dbOpenKey)) {
+ omKeyInfo.getMetadata().put(OzoneConsts.HSYNC_CLIENT_ID,
clientIdString);
+ newOpenKeyInfo = omKeyInfo.copyObject();
Review Comment:
Good idea. Then the mod time in open key would indicate the first time the
key is hsync'ed (since open key will only be updated on the first hsync).
Done.
--
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]