ChenSammi commented on code in PR #6046:
URL: https://github.com/apache/ozone/pull/6046#discussion_r1463293776
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -337,6 +346,13 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager, TermIn
// So that this key can't be committed again.
omMetadataManager.getOpenKeyTable(getBucketLayout()).addCacheEntry(
dbOpenKey, trxnLogIndex);
+
+ // Prevent hsync metadata from getting committed to the final key
+ omKeyInfo.getMetadata().remove(OzoneConsts.HSYNC_CLIENT_ID);
+ } else if (updateOpenKeyTable) {
+ // Both isHSync and updateOpenKeyTable are true, update OpenKeyTable
+ omMetadataManager.getOpenKeyTable(getBucketLayout()).addCacheEntry(
+ dbOpenKey, omKeyInfo, trxnLogIndex);
Review Comment:
You cannot use the same omKeyInfo for keyTable and openKeyTable. There is
one case, that a file's all blocks are per-allocated. Then the openKeyInfo will
have all these blocks info, while the keyInfo only has the hsynced blocks info.
--
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]