-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-9930. Remove open keys as well when keys are deleted from KeyTable #6079
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
jojochuang
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.
Can you double check the test failure in TestHSync? Looks related.
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
Let's check if the TestHSync is related though.
On an unrelated note, validateAndUpdateCache in OMKeyDeleteRequest and OMKeyDeleteRequestWithFSO are largely the same, there has to be a way to merge the code.
|
Thanks @jojochuang for reviewing this.
I did attempt to create a util method just like I did in the other PR but found there are too much variables needed to make it clean. Maybe I could put it in the super class. |
|
There's some flakiness in TestHSync. I wasn't able to reproduce the test failure. |
|
Thanks @smengcl ! |
|
Thanks @jojochuang for reviewing and merging this. |
…le (apache#6079) (cherry picked from commit 2651d4c) Conflicts: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OmKeysDeleteRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeysDeleteResponseWithFSO.java Change-Id: I4d0ad7375cbe2d9b2bd795efeae0b35d6abcc35c
…le (apache#6079) (cherry picked from commit 2651d4c) Conflicts: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OmKeysDeleteRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeysDeleteResponseWithFSO.java
…le (apache#6079) (apache#6472) (cherry picked from commit 2651d4c) Conflicts: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OmKeysDeleteRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeysDeleteResponseWithFSO.java (cherry picked from commit a38570a) Conflicts: hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/OMMetadataManager.java
| () -> fs.getFileStatus(key1)); | ||
| // hsync should throw because the open key is gone | ||
| try { | ||
| os.hsync(); |
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.
I don't think this would throw error as if there is not new block then the second hsync call would be ignore.
reference: https://github.com/apache/ozone/pull/6054/files#diff-db8e4914806b73e8ec37c15ffd146fc70bd1fcba631df9a314c7389af64a895dR377-R382
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.
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.
cc @jojochuang
What changes were proposed in this pull request?
In order to fix the undesired behavior of keys reappearing in the namespace when they are deleted after first being hsync()'ed (see HDDS-9930 description for an example), we need to remove open keys when keys are deleted from
KeyTableso that they cannot be hsync()'ed again. This is achieved by checking OmKeyInfo's hsync metadata upon key deletion.Note as a natural consequence of this change, the first client that does the initial
hsync()can get OMExceptionKEY_NOT_FOUNDwhen trying to close/commit the file.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9930
How was this patch tested?
testHSyncDeletedKeythat covers single key deletion.