-
Notifications
You must be signed in to change notification settings - Fork 599
HDDS-13311. Directory Deleting Service can use deleteRange for subDirectories and subFiles #9423
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
e25e461
4c804dd
65c5bc9
572bd9a
7164ebb
48f32a5
4c95323
4c70d21
e06dd71
c1c6aac
959365c
eee43c0
b44daed
936742b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| import java.util.Map; | ||
| import java.util.UUID; | ||
| import org.apache.commons.lang3.tuple.Pair; | ||
| import org.apache.hadoop.hdds.protocol.proto.HddsProtos; | ||
| import org.apache.hadoop.hdds.utils.db.BatchOperation; | ||
| import org.apache.hadoop.hdds.utils.db.DBStore; | ||
| import org.apache.hadoop.ozone.OmUtils; | ||
|
|
@@ -147,22 +148,22 @@ public void processPaths( | |
| deletedSpaceOmMetadataManager.getDeletedDirTable().putWithBatch(deletedSpaceBatchOperation, | ||
| ozoneDeleteKey, keyInfo); | ||
|
|
||
| keySpaceOmMetadataManager.getDirectoryTable().deleteWithBatch(keySpaceBatchOperation, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aryangupta1998 We should keep the individual deletes to keep the changes backward compatible since we can have a few transactions which could be unflushed in the followers this can lead to split brain. What I would suggest would be to create a new OmDirectoriesPurgeRangeRequest and Response which extends the old implementation and new proto request type enum to have new and old implementation in parallel. We should also have an OM server version bump for this |
||
| ozoneDbKey); | ||
|
|
||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("markDeletedDirList KeyName: {}, DBKey: {}", | ||
| keyInfo.getKeyName(), ozoneDbKey); | ||
| } | ||
| } | ||
|
|
||
| for (HddsProtos.KeyValue keyRanges : path.getDeleteRangeSubDirsList()) { | ||
| keySpaceOmMetadataManager.getDirectoryTable() | ||
| .deleteRangeWithBatch(keySpaceBatchOperation, keyRanges.getKey(), keyRanges.getValue()); | ||
|
aryangupta1998 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| for (OzoneManagerProtocolProtos.KeyInfo key : deletedSubFilesList) { | ||
| OmKeyInfo keyInfo = OmKeyInfo.getFromProtobuf(key) | ||
| .withCommittedKeyDeletedFlag(true); | ||
| String ozoneDbKey = keySpaceOmMetadataManager.getOzonePathKey(volumeId, | ||
| bucketId, keyInfo.getParentObjectID(), keyInfo.getFileName()); | ||
| keySpaceOmMetadataManager.getKeyTable(getBucketLayout()) | ||
| .deleteWithBatch(keySpaceBatchOperation, ozoneDbKey); | ||
|
|
||
| if (LOG.isDebugEnabled()) { | ||
| LOG.info("Move keyName:{} to DeletedTable DBKey: {}", | ||
|
|
@@ -182,6 +183,11 @@ public void processPaths( | |
| deletedKey, repeatedOmKeyInfo); | ||
| } | ||
|
|
||
| for (HddsProtos.KeyValue keyRanges : path.getDeleteRangeSubFilesList()) { | ||
| keySpaceOmMetadataManager.getKeyTable(getBucketLayout()) | ||
| .deleteRangeWithBatch(keySpaceBatchOperation, keyRanges.getKey(), keyRanges.getValue()); | ||
| } | ||
|
|
||
| if (!openKeyInfoMap.isEmpty()) { | ||
| for (Map.Entry<String, OmKeyInfo> entry : openKeyInfoMap.entrySet()) { | ||
| keySpaceOmMetadataManager.getOpenKeyTable(getBucketLayout()).putWithBatch( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.