Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7daaec0
HDDS-8477. Unit test for Snapdiff using tombstone entries
swamirishi May 23, 2023
c061b69
HDDS-7798: SnapDiff : Edge case handling Unit Tests
swamirishi May 23, 2023
6e6f12c
HDDS-7798: Add testcases
swamirishi May 25, 2023
7841d02
HDDS-7798: Add testcases
swamirishi May 30, 2023
f09556e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 2, 2023
3dc2105
HDDS-7798. Merge fix compilation issues
swamirishi Jun 2, 2023
483feb3
HDDS-7798. Merge fix compilation issues
swamirishi Jun 2, 2023
8fa985f
HDDS-7798. Fix testcases
swamirishi Jun 2, 2023
76eba3e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 10, 2023
06c37d5
HDDS-7798. Fix checkstyle for import
swamirishi Jun 12, 2023
a5d451a
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 12, 2023
1393295
HDDS-7798. Fix checkstyle for import
swamirishi Jun 12, 2023
1a0b111
HDDS-7798. Fix merge compilation issues
swamirishi Jun 12, 2023
cb79767
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 22, 2023
4753e89
HDDS-7798: Fix testcases
swamirishi Jun 26, 2023
df354c2
HDDS-7798: Fix testcases
swamirishi Jun 27, 2023
454f55b
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 27, 2023
67f5bef
HDDS-7798: Fix testcases
swamirishi Jun 27, 2023
1219559
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 28, 2023
9663ee0
HDDS-7798: Fix checkstyle
swamirishi Jun 28, 2023
274f359
HDDS-7798: Fix checkstyle
swamirishi Jun 28, 2023
1316a1c
HDDS-7798: Fix checkstyle
swamirishi Jun 28, 2023
9ca14d9
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 29, 2023
6490f87
HDDS-7798: Fix testcases
swamirishi Jun 29, 2023
ab35f05
HDDS-7798: Fix testcases
swamirishi Jun 29, 2023
2710a5d
HDDS-7798: Fix testcases
swamirishi Jun 30, 2023
654b4e8
HDDS-7798: Address review comments
swamirishi Jun 30, 2023
9be29ab
HDDS-7798: Address review comments
swamirishi Jun 30, 2023
cb69ea5
HDDS-7798: Address review comments
swamirishi Jun 30, 2023
19399e7
HDDS-7798. Address review comments
swamirishi Jul 5, 2023
efe7227
HDDS-7798. Address review comments
swamirishi Jul 5, 2023
d81dc5f
HDDS-7798. Address review comments
swamirishi Jul 5, 2023
50a6817
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jul 8, 2023
2c2430a
HDDS-7798. Fix test failures
swamirishi Jul 8, 2023
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
9 changes: 9 additions & 0 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3961,6 +3961,15 @@
</description>
</property>

<property>
<name>ozone.om.snapshot.diff.disable.native.libs</name>
<value>false</value>
<tag>OZONE, OM</tag>
<description>
Flag to perform snapshot diff without using native libs(can be slow).
</description>
</property>

<property>
<name>ozone.om.snapshot.diff.max.page.size</name>
<value>1000</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.rocksdb.RocksDBException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
Expand All @@ -58,9 +56,6 @@
*/
class TestManagedSstFileReader {

private static final Logger LOG =
LoggerFactory.getLogger(TestManagedSstFileReader.class);

// Key prefix containing all characters, to check if all characters can be
// written & read from rocksdb through SSTDumptool
private static final String KEY_PREFIX = IntStream.range(0, 256).boxed()
Expand Down Expand Up @@ -158,6 +153,5 @@ public void testGetKeyStreamWithTombstone(int numberOfFiles)
} finally {
executorService.shutdown();
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -668,19 +668,23 @@ private List<OzoneSnapshot> getNextListOfSnapshots(String prevSnapshot)
* @param token to get the index to return diff report from.
* @param pageSize maximum entries returned to the report.
* @param forceFullDiff request to force full diff, skipping DAG optimization
* @param disableNativeDiff request to force diff to perform diffs without
* native lib
* @return the difference report between two snapshots
* @throws IOException in case of any exception while generating snapshot diff
*/
@SuppressWarnings("parameternumber")
public SnapshotDiffResponse snapshotDiff(String volumeName,
String bucketName,
String fromSnapshot,
String toSnapshot,
String token,
int pageSize,
boolean forceFullDiff)
boolean forceFullDiff,
boolean disableNativeDiff)
throws IOException {
return proxy.snapshotDiff(volumeName, bucketName, fromSnapshot, toSnapshot,
token, pageSize, forceFullDiff);
token, pageSize, forceFullDiff, disableNativeDiff);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,10 +1071,12 @@ List<OzoneSnapshot> listSnapshot(
* @return the difference report between two snapshots
* @throws IOException in case of any exception while generating snapshot diff
*/
@SuppressWarnings("parameternumber")
SnapshotDiffResponse snapshotDiff(String volumeName, String bucketName,
String fromSnapshot, String toSnapshot,
String token, int pageSize,
boolean forceFullDiff)
boolean forceFullDiff,
boolean disableNativeDiff)
throws IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,14 +987,16 @@ public SnapshotDiffResponse snapshotDiff(String volumeName,
String toSnapshot,
String token,
int pageSize,
boolean forceFullDiff)
boolean forceFullDiff,
boolean disableNativeDiff)
throws IOException {
Preconditions.checkArgument(StringUtils.isNotBlank(volumeName),
"volume can't be null or empty.");
Preconditions.checkArgument(StringUtils.isNotBlank(bucketName),
"bucket can't be null or empty.");
return ozoneManagerClient.snapshotDiff(volumeName, bucketName,
fromSnapshot, toSnapshot, token, pageSize, forceFullDiff);
fromSnapshot, toSnapshot, token, pageSize, forceFullDiff,
disableNativeDiff);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ private OMConfigKeys() {

public static final boolean OZONE_OM_SNAPSHOT_FORCE_FULL_DIFF_DEFAULT = false;

public static final String OZONE_OM_SNAPSHOT_DIFF_DISABLE_NATIVE_LIBS =
"ozone.om.snapshot.diff.disable.native.libs";

public static final boolean
OZONE_OM_SNAPSHOT_DIFF_DISABLE_NATIVE_LIBS_DEFAULT = false;
public static final String OZONE_OM_SNAPSHOT_DIFF_DB_DIR
= "ozone.om.snapshot.diff.db.dir";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void addAll(long versionToAdd, List<OmKeyLocationInfo> locationInfoList) {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("version:").append(version).append(" ");
sb.append("isMultipartKey:").append(isMultipartKey);
sb.append("isMultipartKey:").append(isMultipartKey).append(" ");
for (List<OmKeyLocationInfo> kliList : locationVersionMap.values()) {
for (OmKeyLocationInfo kli: kliList) {
sb.append(kli.getLocalID()).append(" || ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static Codec<SnapshotDiffJob> getCodec() {
private String fromSnapshot;
private String toSnapshot;
private boolean forceFullDiff;
private boolean disableNativeDiff;
private long totalDiffEntries;

// Reason tells why the job was FAILED. It should be set only if job status
Expand All @@ -68,6 +69,7 @@ public SnapshotDiffJob(long creationTime,
String fromSnapshot,
String toSnapshot,
boolean forceFullDiff,
boolean disableNativeDiff,
long totalDiffEntries) {
this.creationTime = creationTime;
this.jobId = jobId;
Expand All @@ -77,6 +79,7 @@ public SnapshotDiffJob(long creationTime,
this.fromSnapshot = fromSnapshot;
this.toSnapshot = toSnapshot;
this.forceFullDiff = forceFullDiff;
this.disableNativeDiff = disableNativeDiff;
this.totalDiffEntries = totalDiffEntries;
this.reason = StringUtils.EMPTY;
}
Expand Down Expand Up @@ -161,6 +164,14 @@ public void setReason(String reason) {
this.reason = reason;
}

public boolean isNativeDiffDisabled() {
return disableNativeDiff;
}

public void disableNativeDiff(boolean disableNativeDiffVal) {
this.disableNativeDiff = disableNativeDiffVal;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder("creationTime : ").append(creationTime)
Expand All @@ -171,6 +182,7 @@ public String toString() {
.append(", fromSnapshot: ").append(fromSnapshot)
.append(", toSnapshot: ").append(toSnapshot)
.append(", forceFullDiff: ").append(forceFullDiff)
.append(", disableNativeDiff: ").append(disableNativeDiff)
.append(", totalDiffEntries: ").append(totalDiffEntries);

if (StringUtils.isNotEmpty(reason)) {
Expand All @@ -196,15 +208,17 @@ public boolean equals(Object other) {
Objects.equals(this.toSnapshot, otherJob.toSnapshot) &&
Objects.equals(this.forceFullDiff, otherJob.forceFullDiff) &&
Objects.equals(this.totalDiffEntries, otherJob.totalDiffEntries) &&
Objects.equals(this.reason, otherJob.reason);
Objects.equals(this.disableNativeDiff, otherJob.disableNativeDiff)
&& Objects.equals(this.reason, otherJob.reason);
}
return false;
}

@Override
public int hashCode() {
return Objects.hash(creationTime, jobId, status, volume, bucket,
fromSnapshot, toSnapshot, forceFullDiff, totalDiffEntries, reason);
fromSnapshot, toSnapshot, forceFullDiff, disableNativeDiff,
totalDiffEntries, reason);
}

public SnapshotDiffJobProto toProtoBuf() {
Expand All @@ -217,6 +231,7 @@ public SnapshotDiffJobProto toProtoBuf() {
.setFromSnapshot(fromSnapshot)
.setToSnapshot(toSnapshot)
.setForceFullDiff(forceFullDiff)
.setDisableNativeDiff(disableNativeDiff)
.setTotalDiffEntries(totalDiffEntries)
.build();
}
Expand All @@ -232,6 +247,7 @@ public static SnapshotDiffJob getFromProtoBuf(
diffJobProto.getFromSnapshot(),
diffJobProto.getToSnapshot(),
diffJobProto.getForceFullDiff(),
diffJobProto.getDisableNativeDiff(),
diffJobProto.getTotalDiffEntries());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,13 +720,15 @@ default List<SnapshotInfo> listSnapshot(
* @return the difference report between two snapshots
* @throws IOException in case of any exception while generating snapshot diff
*/
@SuppressWarnings("parameternumber")
default SnapshotDiffResponse snapshotDiff(String volumeName,
String bucketName,
String fromSnapshot,
String toSnapshot,
String token,
int pageSize,
boolean forceFullDiff)
boolean forceFullDiff,
boolean disableNativeDiff)
throws IOException {
throw new UnsupportedOperationException("OzoneManager does not require " +
"this to be implemented");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,8 @@ public SnapshotDiffResponse snapshotDiff(String volumeName,
String toSnapshot,
String token,
int pageSize,
boolean forceFullDiff)
boolean forceFullDiff,
boolean disableNativeDiff)
throws IOException {
final OzoneManagerProtocolProtos.SnapshotDiffRequest.Builder
requestBuilder =
Expand All @@ -1242,7 +1243,8 @@ public SnapshotDiffResponse snapshotDiff(String volumeName,
.setFromSnapshot(fromSnapshot)
.setToSnapshot(toSnapshot)
.setPageSize(pageSize)
.setForceFullDiff(forceFullDiff);
.setForceFullDiff(forceFullDiff)
.setDisableNativeDiff(disableNativeDiff);

if (!StringUtils.isBlank(token)) {
requestBuilder.setToken(token);
Expand Down
Loading