HDDS-8686. [Snapshot] SnapshotDeletingService to reclaim old versions of key.#4811
HDDS-8686. [Snapshot] SnapshotDeletingService to reclaim old versions of key.#4811aswinshakil merged 7 commits intoapache:masterfrom
Conversation
… in the active db deletedTable
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockLocationInfo.java
Outdated
Show resolved
Hide resolved
|
@aswinshakil I am not getting when object Id is same but content is different ? I can see only case is HSync. Further, in delete flow, objectId will be unique, so it does not need compare any details, all delete task is independent, only objectId compare is enough. |
|
@sumitagrawl When we overwrite a key, the object ID remains the same but the key is different. Although at a time only one version exists (by default bucket version is turned off). During snapshot deletion, multiple versions of the keys with the same objectID are moved to either next snapshot or active db's In this case, we might need to check the block locations as well to confirm if it is the same version of the key. |
|
@aswinshakil Thanks for the info, overwrite case can have same objectId but different version of content.
I think, we can have a change in KeyInfo have have additional field - version, which can be auto-incremented in case of overwrite to distinguish different object and also for debugging identifying overwrite. This can be used to replace blockId compare. |
swamirishi
left a comment
There was a problem hiding this comment.
Minor comments otherwise changes look good
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java
Outdated
Show resolved
Hide resolved
| return Pair.of(keyBlocksList, keysToModify); | ||
| } | ||
|
|
||
| private boolean versionExistsInPreviousSnapshot(OmKeyInfo omKeyInfo, |
There was a problem hiding this comment.
Parameter names nomenclature could be better.
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java
Show resolved
Hide resolved
...e/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestSnapshotDeletingService.java
Outdated
Show resolved
Hide resolved
...ain/java/org/apache/hadoop/ozone/om/response/snapshot/OMSnapshotMoveDeletedKeysResponse.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/PendingKeysDeletion.java
Show resolved
Hide resolved
sumitagrawl
left a comment
There was a problem hiding this comment.
@aswinshakil Thanks working over this, have few comments and query ...
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
.../ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyPurgeResponse.java
Show resolved
Hide resolved
smengcl
left a comment
There was a problem hiding this comment.
+1, pending Sumit's comments resolution
|
Thanks @smengcl @swamirishi @sumitagrawl for the review. |
What changes were proposed in this pull request?
When a key is overwritten, it will still have the same object ID as the previous version of the key. So only the object ID check between snapshots is not enough to prove the key is same. This patch does an additional check on the
OMBlockLocationInfoGroup.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8686
How was this patch tested?
The patch was tested using updated existing test.
