Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a023c28
HDDS-11244. Draft PR to address multiple issues in garbage collection…
swamirishi Aug 20, 2024
c4e78d9
Safety commit
swamirishi Sep 5, 2024
851153e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Sep 5, 2024
536b63a
Push interim merge in progress
swamirishi Sep 5, 2024
e030d90
Push interim merge in progress
swamirishi Sep 7, 2024
2640d27
Push interim merge in progress
swamirishi Sep 9, 2024
d44686a
Push interim merge in progress
swamirishi Sep 9, 2024
74d1ebc
Test fixes
swamirishi Sep 9, 2024
da5ff0a
Flush snapshot info
swamirishi Sep 9, 2024
831cd46
HDDS-11440. Add a lastTransactionInfo field in SnapshotInfo to check …
swamirishi Sep 10, 2024
eebd1ce
Fix OmSnapshotMoveTableKeys request
swamirishi Sep 11, 2024
4ff6a6e
HDDS-11440. Address review comments
swamirishi Sep 11, 2024
dc55f37
HDDS-11440. Address review comments
swamirishi Sep 11, 2024
e556129
HDDS-11440. Address review comments
swamirishi Sep 11, 2024
b32d074
HDDS-11440. Address review comments
swamirishi Sep 11, 2024
2d4b18a
Merge remote-tracking branch 'origin/HDDS-11440' into HEAD
swamirishi Sep 11, 2024
dc83f85
Merge with HDDS-11440
swamirishi Sep 11, 2024
b5f21a0
HDDS-11411. Snapshot garbage collection should not run when the keys …
swamirishi Sep 12, 2024
177386a
Merge remote-tracking branch 'apache/master' into HDDS-11244
swamirishi Sep 12, 2024
4d22b05
Merge remote-tracking branch 'origin/HDDS-11411' into HDDS-11244
swamirishi Sep 12, 2024
29ab212
Merge
swamirishi Sep 12, 2024
d06414e
Merge
swamirishi Sep 13, 2024
c1eb878
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Sep 13, 2024
4520004
Fix checkstyle
swamirishi Sep 13, 2024
ac74e51
HDDS-11244. Fix race condition b/w create snapshot & AOS key deleting…
swamirishi Sep 20, 2024
51c6a5c
Merge remote-tracking branch 'apache/master' into HDDS-11244
swamirishi Oct 17, 2024
200c9a7
HDDS-11244. Merge
swamirishi Oct 21, 2024
91a4c42
HDDS-11244. Fix Checkstyle
swamirishi Oct 21, 2024
c509cc3
Merge remote-tracking branch 'apache/master' into HDDS-11244
swamirishi Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public enum ResultCodes {
FAILED_TO_FIND_CONTAINER,
FAILED_TO_FIND_CONTAINER_WITH_SPACE,
BLOCK_EXISTS,
//OM can send a deleteBlockRequest for key delete more than once. Thus, it shouldn't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this from the change as well.

// fail the request since SCM already deleted the block in the previous run. We should never use this enum.
@Deprecated
FAILED_TO_FIND_BLOCK,
IO_EXCEPTION,
UNEXPECTED_CONTAINER_STATE,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.apache.hadoop.ozone.util;

/**
*
* Represents a function that accepts one argument and produces a result.
* This is a functional interface whose functional method is apply(Object).
* Type parameters:
* <T> – the type of the input to the function <R> – the type of the result of the function
* <E> - the type of exception thrown.
*/
public interface CheckedExceptionOperation<T, R, E extends Exception> {
R apply(T t) throws E;

default <V> CheckedExceptionOperation<T, V, E> andThen(CheckedExceptionOperation<R, V, E> operation) throws E {
return (T t) -> operation.apply(this.apply(t));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -282,18 +282,11 @@ public List<DeleteBlockGroupResult> deleteKeyBlocks(
e = ioe;
perfMetrics.updateDeleteKeyFailureStats(startNanos);
LOG.warn("Fail to delete {} keys", keyBlocksInfoList.size(), ioe);
switch (ioe instanceof SCMException ? ((SCMException) ioe).getResult() :
IO_EXCEPTION) {
case SAFE_MODE_EXCEPTION:
if ((ioe instanceof SCMException ? ((SCMException) ioe).getResult() :
IO_EXCEPTION) == SCMException.ResultCodes.SAFE_MODE_EXCEPTION) {
resultCode =
ScmBlockLocationProtocolProtos.DeleteScmBlockResult.Result.safeMode;
break;
case FAILED_TO_FIND_BLOCK:
resultCode =
ScmBlockLocationProtocolProtos.DeleteScmBlockResult.Result.
errorNotFound;
break;
default:
} else {
resultCode =
ScmBlockLocationProtocolProtos.DeleteScmBlockResult.Result.
unknownFailure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private OMConfigKeys() {
* Configuration properties for Snapshot Directory Service.
*/
public static final String OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED = "ozone.snapshot.deep.cleaning.enabled";
public static final boolean OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED_DEFAULT = false;
public static final boolean OZONE_SNAPSHOT_DEEP_CLEANING_ENABLED_DEFAULT = true;
public static final String OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL =
"ozone.snapshot.directory.service.interval";
public static final String OZONE_SNAPSHOT_DIRECTORY_SERVICE_INTERVAL_DEFAULT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ public enum Resource {
S3_SECRET_LOCK((byte) 4, "S3_SECRET_LOCK"), // 31
KEY_PATH_LOCK((byte) 5, "KEY_PATH_LOCK"), //63
PREFIX_LOCK((byte) 6, "PREFIX_LOCK"), //127
SNAPSHOT_LOCK((byte) 7, "SNAPSHOT_LOCK"); // = 255
SNAPSHOT_LOCK((byte) 7, "SNAPSHOT_LOCK"), // = 255
SNAPSHOT_GC_LOCK((byte) 8, "SNAPSHOT_GC_LOCK");

// level of the resource
private byte lockLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void testKeysPurgingByKeyDeletingService() throws Exception {
GenericTestUtils.waitFor(
() -> {
try {
return keyManager.getPendingDeletionKeys(Integer.MAX_VALUE)
return keyManager.getPendingDeletionKeys(null, Integer.MAX_VALUE)
.getKeyBlocksList().size() == 0;
} catch (IOException e) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,9 @@ public void testParallelExcecutionOfKeyDeletionAndSnapshotDeletion() throws Exce
try (ReferenceCounted<OmSnapshot> snapshot = om.getOmSnapshotManager().getSnapshot(testBucket.getVolumeName(),
testBucket.getName(), testBucket.getName() + "snap2")) {
renamesKeyEntries = snapshot.get().getKeyManager().getRenamesKeyEntries(testBucket.getVolumeName(),
testBucket.getName(), "", 1000);
testBucket.getName(), "", (kv) -> true, 1000);
deletedKeyEntries = snapshot.get().getKeyManager().getDeletedKeyEntries(testBucket.getVolumeName(),
testBucket.getName(), "", 1000);
testBucket.getName(), "", (kv) -> true, 1000);
deletedDirEntries = snapshot.get().getKeyManager().getDeletedDirEntries(testBucket.getVolumeName(),
testBucket.getName(), 1000);
}
Expand Down Expand Up @@ -669,20 +669,20 @@ public void testParallelExcecutionOfKeyDeletionAndSnapshotDeletion() throws Exce
testBucket.getName(), testBucket.getName() + "snap2")) {
Assertions.assertEquals(Collections.emptyList(),
snapshot.get().getKeyManager().getRenamesKeyEntries(testBucket.getVolumeName(),
testBucket.getName(), "", 1000));
testBucket.getName(), "", (kv) -> true, 1000));
Assertions.assertEquals(Collections.emptyList(),
snapshot.get().getKeyManager().getDeletedKeyEntries(testBucket.getVolumeName(),
testBucket.getName(), "", 1000));
testBucket.getName(), "", (kv) -> true, 1000));
Assertions.assertEquals(Collections.emptyList(),
snapshot.get().getKeyManager().getDeletedDirEntries(testBucket.getVolumeName(),
testBucket.getName(), 1000));
}
List<Table.KeyValue<String, String>> aosRenamesKeyEntries =
om.getKeyManager().getRenamesKeyEntries(testBucket.getVolumeName(),
testBucket.getName(), "", 1000);
testBucket.getName(), "", (kv) -> true, 1000);
List<Table.KeyValue<String, List<OmKeyInfo>>> aosDeletedKeyEntries =
om.getKeyManager().getDeletedKeyEntries(testBucket.getVolumeName(),
testBucket.getName(), "", 1000);
testBucket.getName(), "", (kv) -> true, 1000);
List<Table.KeyValue<String, OmKeyInfo>> aosDeletedDirEntries =
om.getKeyManager().getDeletedDirEntries(testBucket.getVolumeName(),
testBucket.getName(), 1000);
Expand Down

This file was deleted.

Loading