-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10077. Add hsync metadata to hsync'ed keys in OpenKeyTable as well #6046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sumitagrawl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smengcl Thanks for working over this, having few query,
-
adding metadata while commit will not resolve missing hsync commit for first time till fsync not called by client. Do we have plan to resolve by adding hsync flag while open keyfile ?
-
Related to performance, this interface will not be called in normal path. additionally checking key existence for open key is very fast. Do this provide any measurable performance improvement?
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Outdated
Show resolved
Hide resolved
|
Thanks @sumitagrawl for the comments.
If the client hasn't called
It's not merely checking key existence in KeyTable, it is extra key look up + extra DB value deserialization + metadata check. Deserialization the large value byte array that stores |
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
Outdated
Show resolved
Hide resolved
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
Outdated
Show resolved
Hide resolved
sumitagrawl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smengcl Have few minor comments
...-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequestWithFSO.java
Show resolved
Hide resolved
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
Show resolved
Hide resolved
Conflicts: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java Change-Id: Ieabb87c5c1477ab94290602a70d62aa1c8ea536f
|
Regarding the test failure with the last commit: After a few hours of debugging, I found the new test This specific test wasn't previously failing because Lines 256 to 262 in a15c9ae
So far it looks like a test issue rather than the code issue and I have adjusted the test to make it pass. Pls check if this is the desired behavior @ChenSammi . |
|
LGTM |
sumitagrawl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...e/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
Show resolved
Hide resolved
...one-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java
Show resolved
Hide resolved
| 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modification time should be updated for newOpenKeyInfo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@smengcl , thanks for the finding. The fix is good. |
ChenSammi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last patch looks good, + 1.
|
Thanks @sumitagrawl @ChenSammi @jojochuang for reviewing this. |
What changes were proposed in this pull request?
Currently, only those keys in
KeyTablewould have metadataHSYNC_CLIENT_IDwhen those keys have been hsync'ed (and not closed/committed yet). One problem with this is that it makesgetExpiredOpenKeys()andlistOpenKeys()(HDDS-8830) inefficient by forcing them to look upKeyTablewhile they could have just usedOpenKeyTablesolely to determine whether an open key is hsync'ed or not.Changes
hsync(), persist metadataHSYNC_CLIENT_IDtoOmKeyInfoinOpenKeyTableas well, in addition toKeyTable. Only write when the client ID changes so it doesn't lead to excessive writes. Ideally, only the first hsync() would lead to aOpenKeyTablewrite of that key.close(), removeHSYNC_CLIENT_IDfrom OpenKeyTable if any, so thatHSYNC_CLIENT_IDisn't unnecessarily written to the final key (which is useless when the key is committed/finalized.getExpiredOpenKeys()andlistOpenKeys().What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10077
How was this patch tested?
testKeyMetadatato check the intended behavior.