HDDS-9930. Remove open keys as well when keys are deleted from KeyTable#6079
HDDS-9930. Remove open keys as well when keys are deleted from KeyTable#6079jojochuang merged 3 commits intoapache:HDDS-7593from
Conversation
jojochuang
left a comment
There was a problem hiding this comment.
Can you double check the test failure in TestHSync? Looks related.
|
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.
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
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.