Skip to content

Commit

Permalink
HDDS-10680. Duplicate delete key blocks sent to SCM (apache#6513)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenSammi authored Apr 17, 2024
1 parent fdc38b5 commit 7bb7938
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ protected int processKeyDeletes(List<BlockGroup> keyBlocksList,
}
List<DeleteBlockGroupResult> blockDeletionResults =
scmClient.deleteKeyBlocks(keyBlocksList);
LOG.info("{} BlockGroup deletion are acked by SCM in {} ms",
keyBlocksList.size(), Time.monotonicNow() - startTime);
if (blockDeletionResults != null) {
startTime = Time.monotonicNow();
if (isRatisEnabled()) {
delCount = submitPurgeKeysRequest(blockDeletionResults,
keysToModify, snapTableKey);
Expand All @@ -126,11 +129,8 @@ protected int processKeyDeletes(List<BlockGroup> keyBlocksList,
// OMRequest model.
delCount = deleteAllKeys(blockDeletionResults, manager);
}
if (LOG.isDebugEnabled()) {
LOG.debug("Blocks for {} (out of {}) keys are deleted in {} ms",
delCount, blockDeletionResults.size(),
Time.monotonicNow() - startTime);
}
LOG.info("Blocks for {} (out of {}) keys are deleted from DB in {} ms",
delCount, blockDeletionResults.size(), Time.monotonicNow() - startTime);
}
return delCount;
}
Expand Down Expand Up @@ -277,12 +277,14 @@ protected RaftClientRequest createRaftClientRequestForPurge(
* Parse Volume and Bucket Name from ObjectKey and add it to given map of
* keys to be purged per bucket.
*/
private void addToMap(Map<Pair<String, String>, List<String>> map,
String objectKey) {
private void addToMap(Map<Pair<String, String>, List<String>> map, String objectKey) {
// Parse volume and bucket name
String[] split = objectKey.split(OM_KEY_PREFIX);
Preconditions.assertTrue(split.length > 3, "Volume and/or Bucket Name " +
"missing from Key Name.");
Preconditions.assertTrue(split.length >= 3, "Volume and/or Bucket Name " +
"missing from Key Name " + objectKey);
if (split.length == 3) {
LOG.warn("{} missing Key Name", objectKey);
}
Pair<String, String> volumeBucketPair = Pair.of(split[1], split[2]);
if (!map.containsKey(volumeBucketPair)) {
map.put(volumeBucketPair, new ArrayList<>());
Expand Down

0 comments on commit 7bb7938

Please sign in to comment.