ChenSammi commented on code in PR #6054:
URL: https://github.com/apache/ozone/pull/6054#discussion_r1465766476
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java:
##########
@@ -368,7 +371,16 @@ void hsyncKey(long offset) throws IOException {
if (keyArgs.getIsMultipartKey()) {
throw new IOException("Hsync is unsupported for multipart keys.");
} else {
- omClient.hsyncKey(keyArgs, openID);
+ if (keyArgs.getLocationInfoList().size() == 0) {
+ omClient.hsyncKey(keyArgs, openID);
+ } else {
+ ContainerBlockID lastBLockId =
keyArgs.getLocationInfoList().get(keyArgs.getLocationInfoList().size() - 1)
+ .getBlockID().getContainerBlockID();
+ if (!lastUpdatedBlockId.equals(lastBLockId)) {
+ omClient.hsyncKey(keyArgs, openID);
Review Comment:
when a new block is allocated, only the openKeyInfo is updated with new
block with the block default size, the keyInfo will not get updated. Only the
keyCommit(hsyncKey) will update the keyInfo with a real block data length. For
the same key, the major difference of openKeyInfo and keyInfo is openKeyInfo
will have all allocated block info, while keyInfo will have all blocks(which
has real data) 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]