smengcl commented on code in PR #6046:
URL: https://github.com/apache/ozone/pull/6046#discussion_r1462808433
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -1888,19 +1859,19 @@ public ExpiredOpenKeys getExpiredOpenKeys(Duration
expireThreshold,
} else {
// add hsync'ed keys
final KeyArgs.Builder keyArgs = KeyArgs.newBuilder()
- .setVolumeName(info.getVolumeName())
- .setBucketName(info.getBucketName())
- .setKeyName(info.getKeyName())
- .setDataSize(info.getDataSize());
- java.util.Optional.ofNullable(info.getLatestVersionLocations())
+ .setVolumeName(openKeyInfo.getVolumeName())
+ .setBucketName(openKeyInfo.getBucketName())
+ .setKeyName(openKeyInfo.getKeyName())
+ .setDataSize(openKeyInfo.getDataSize());
Review Comment:
Good catch. Indeed, since it only updates `OpenKeyTable` on the first hsync
call it won't always have the latest size:
https://github.com/apache/ozone/blob/HDDS-7593/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java#L272
**If** accurate data size here is a must, either `OpenKeyTable` have to be
updated on every single hsync (which I don't like), or `getExpiredOpenKeys`
have to resort to `KeyTable` again.
--
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]