Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6e241f6
HDDS-13765. SnapshotLocalData yaml should also track snapshotId
swamirishi Oct 8, 2025
a869500
HDDS-13627. In memory Manager for Snapshot Local Data
swamirishi Oct 8, 2025
252d338
HDDS-13627. In memory Manager for Snapshot Local Data
swamirishi Oct 9, 2025
4099bc6
HDDS-13767. Refactor SnapshotLocalDataYaml related code into OmSnapsh…
swamirishi Oct 9, 2025
e02670c
HDDS-13767. Fix pmd
swamirishi Oct 9, 2025
5a66cfc
Merge remote-tracking branch 'origin/HDDS-13767' into HEAD
swamirishi Oct 9, 2025
79580e9
HDDS-13627. Fix checkstyle
swamirishi Oct 9, 2025
2a331ef
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 9, 2025
c4f69e2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 10, 2025
afbc592
HDDS-13627. Add tests
swamirishi Oct 10, 2025
70ac2c7
HDDS-13783. Implement locks for OmSnapshotLocalDataManager
swamirishi Oct 12, 2025
b554cc7
HDDS-13783. Implement locks for OmSnapshotLocalDataManager
swamirishi Oct 12, 2025
49eccfa
HDDS-13783. Refactor inline variable
swamirishi Oct 12, 2025
51eda04
HDDS-13627. Refactor map data structure
swamirishi Oct 13, 2025
25f766c
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 13, 2025
96689fa
HDDS-13783. Add more condition to upsert
swamirishi Oct 13, 2025
0674299
HDDS-13783. Add java doc comment
swamirishi Oct 13, 2025
5d9fc49
HDDS-13783. Add java doc comment
swamirishi Oct 13, 2025
2d88176
HDDS-13783. Implement full lock
swamirishi Oct 13, 2025
a3c4c69
HDDS-13783. Refactor and move modify method into WritableOmSnapshotLo…
swamirishi Oct 13, 2025
686d0c7
HDDS-13783. Make full lock non static
swamirishi Oct 13, 2025
491a54b
HDDS-13783. Fix remove
swamirishi Oct 13, 2025
5e69ee9
HDDS-13627. Fix findbugs
swamirishi Oct 13, 2025
81871b2
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 14, 2025
a95604e
HDDS-13627. Fix tests
swamirishi Oct 14, 2025
5a90fcf
HDDS-13627. remove checksum interface
swamirishi Oct 14, 2025
20d7d6a
HDDS-13627. Fix test failures
swamirishi Oct 14, 2025
25fa6ae
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 14, 2025
d419283
HDDS-13783. Fix findbugs
swamirishi Oct 14, 2025
8a44308
HDDS-13783. Fix pmd
swamirishi Oct 14, 2025
cb94c36
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 14, 2025
e26052c
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 14, 2025
4d272d1
HDDS-13783. Fix lock release
swamirishi Oct 14, 2025
2a38f59
HDDS-13627. address review comments
swamirishi Oct 14, 2025
ca098cf
HDDS-13783. Make graph updates synchronized
swamirishi Oct 15, 2025
67d4b3d
HDDS-13627. Make add version with dependents package private
swamirishi Oct 15, 2025
9838cda
Merge remote-tracking branch 'origin/HDDS-13627' into HEAD
swamirishi Oct 15, 2025
6a19dbb
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 15, 2025
665f411
HDDS-13783. Fix checkstyle
swamirishi Oct 15, 2025
2894e40
HDDS-13783. Fix merge conflict
swamirishi Oct 15, 2025
ea0ab16
HDDS-13783. Add write version api
swamirishi Oct 15, 2025
915562b
HDDS-13797. Refactor OzoneManagerLock Resource class to handle handle…
swamirishi Oct 15, 2025
1c0d0ac
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 15, 2025
24da3eb
HDDS-13797. Update interface
swamirishi Oct 15, 2025
8f3774a
HDDS-13798. Implement PoolBasedHierarchicalResourceLockManager for Hi…
swamirishi Oct 15, 2025
503cd4e
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
6865fad
HDDS-13797. Revert move of Leveled Resource and Resource enum/interface
swamirishi Oct 15, 2025
903ecd1
Merge remote-tracking branch 'origin/HDDS-13797' into HEAD
swamirishi Oct 15, 2025
06d1e99
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
60a7728
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 15, 2025
4711517
HDDS-13798. Fix pmd findbugs
swamirishi Oct 15, 2025
af8754c
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
655a724
HDDS-13798. Fix pmd findbugs
swamirishi Oct 15, 2025
6386c1b
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 15, 2025
2bc6134
HDDS-13798. Fix ozone-default.xml
swamirishi Oct 16, 2025
0de7c62
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 16, 2025
8e8c534
HDDS-13798. Stop lock data manager on metadata stop
swamirishi Oct 16, 2025
f148f24
HDDS-13798. Update tests
swamirishi Oct 16, 2025
da030c0
HDDS-13798. Rename class
swamirishi Oct 16, 2025
6af6498
Merge remote-tracking branch 'origin/HDDS-13798' into HEAD
swamirishi Oct 16, 2025
b281569
HDDS-13783. Add tests
swamirishi Oct 16, 2025
1ad24b4
HDDS-13783. Fix checkstyle
swamirishi Oct 16, 2025
d629911
HDDS-13783. Fix findbugs
swamirishi Oct 16, 2025
8eeb44b
HDDS-13783. Fix pmd
swamirishi Oct 16, 2025
d9301b3
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 16, 2025
c73a355
HDDS-13783. Fix test
swamirishi Oct 16, 2025
52be3dd
HDDS-13783. Allow version resolution to null
swamirishi Oct 16, 2025
278605a
HDDS-13783. Add dirty bit
swamirishi Oct 17, 2025
cf19dce
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
34097de
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
c46ddc2
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
99afc02
HDDS-13783. Address review comments
swamirishi Oct 17, 2025
48ec0bb
HDDS-13810. Fix Build Issue because of unused dependency
swamirishi Oct 18, 2025
f524cad
Merge remote-tracking branch 'origin/HDDS-13810' into HEAD
swamirishi Oct 18, 2025
cb31b7c
Revert "HDDS-13810. Fix Build Issue because of unused dependency"
swamirishi Oct 19, 2025
8b014dd
HDDS-13783. Add case for commit key in middle of chain
swamirishi Oct 20, 2025
57662c6
HDDS-13783. Convert set to list of predecessors
swamirishi Oct 20, 2025
79a46f4
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 23, 2025
aa6facf
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 24, 2025
cc35056
HDDS-13783. Make local data graph synchrnous
swamirishi Oct 25, 2025
95341dd
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 27, 2025
616bef3
HDDS-13783. Fix NPE with concurrentHashMap
swamirishi Oct 27, 2025
b0023d1
HDDS-13830. Snapshot Rocks DB directory path computation based on loc…
swamirishi Oct 28, 2025
36b6fb3
HDDS-13830. Add test
swamirishi Oct 28, 2025
4596386
HDDS-13783. Add comments for localDataGraph
swamirishi Oct 29, 2025
25ee4e2
Merge remote-tracking branch 'origin/HDDS-13783' into HEAD
swamirishi Oct 29, 2025
c6e3914
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 29, 2025
e58ff09
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Oct 31, 2025
408e213
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 1, 2025
c829a8b
HDDS-13830. Fix test
swamirishi Nov 1, 2025
8e91e47
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 1, 2025
bfd341c
HDDS-13830. Fix test
swamirishi Nov 1, 2025
4ccd3fc
HDDS-13830. Fix test
swamirishi Nov 1, 2025
41b7cfb
HDDS-13830. Fix pmd
swamirishi Nov 1, 2025
3a8c8f6
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Nov 2, 2025
d0422ae
HDDS-13830. Fix mrge issue
swamirishi Nov 2, 2025
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 @@ -192,7 +192,7 @@ public static OzoneSnapshot fromSnapshotInfo(SnapshotInfo snapshotInfo) {
snapshotInfo.getSnapshotStatus(),
snapshotInfo.getSnapshotId(),
snapshotInfo.getSnapshotPath(),
snapshotInfo.getCheckpointDir(),
snapshotInfo.getCheckpointDirName(0),
snapshotInfo.getReferencedSize(),
snapshotInfo.getReferencedReplicatedSize(),
snapshotInfo.getExclusiveSize() + snapshotInfo.getExclusiveSizeDeltaFromDirDeepCleaning(),
Expand Down Expand Up @@ -222,4 +222,22 @@ public int hashCode() {
return Objects.hash(volumeName, bucketName, name, creationTime, snapshotStatus, snapshotId, snapshotPath,
checkpointDir, referencedSize, referencedReplicatedSize, exclusiveSize, exclusiveReplicatedSize);
}

@Override
public String toString() {
return "OzoneSnapshot{" +
"bucketName='" + bucketName + '\'' +
", volumeName='" + volumeName + '\'' +
", name='" + name + '\'' +
", creationTime=" + creationTime +
", snapshotStatus=" + snapshotStatus +
", snapshotId=" + snapshotId +
", snapshotPath='" + snapshotPath + '\'' +
", checkpointDir='" + checkpointDir + '\'' +
", referencedSize=" + referencedSize +
", referencedReplicatedSize=" + referencedReplicatedSize +
", exclusiveSize=" + exclusiveSize +
", exclusiveReplicatedSize=" + exclusiveReplicatedSize +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.apache.hadoop.ozone.om.helpers.SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;

import java.util.UUID;
Expand All @@ -40,7 +41,7 @@ private SnapshotInfo getMockedSnapshotInfo(UUID snapshotId) {
when(snapshotInfo.getSnapshotStatus()).thenReturn(SNAPSHOT_ACTIVE);
when(snapshotInfo.getSnapshotId()).thenReturn(snapshotId);
when(snapshotInfo.getSnapshotPath()).thenReturn("volume/bucket");
when(snapshotInfo.getCheckpointDir()).thenReturn("checkpointDir");
when(snapshotInfo.getCheckpointDirName(eq(0))).thenReturn("checkpointDir");
when(snapshotInfo.getReferencedSize()).thenReturn(1000L);
when(snapshotInfo.getReferencedReplicatedSize()).thenReturn(3000L);
when(snapshotInfo.getExclusiveSize()).thenReturn(4000L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public final class SnapshotInfo implements Auditable, CopyObject<SnapshotInfo> {
private UUID pathPreviousSnapshotId;
private UUID globalPreviousSnapshotId;
private String snapshotPath; // snapshot mask
private String checkpointDir;
/**
* RocksDB's transaction sequence number at the time of checkpoint creation.
*/
Expand Down Expand Up @@ -99,7 +98,6 @@ private SnapshotInfo(Builder b) {
this.pathPreviousSnapshotId = b.pathPreviousSnapshotId;
this.globalPreviousSnapshotId = b.globalPreviousSnapshotId;
this.snapshotPath = b.snapshotPath;
this.checkpointDir = b.checkpointDir;
this.dbTxSequenceNumber = b.dbTxSequenceNumber;
this.deepClean = b.deepClean;
this.sstFiltered = b.sstFiltered;
Expand Down Expand Up @@ -150,10 +148,6 @@ public void setSnapshotPath(String snapshotPath) {
this.snapshotPath = snapshotPath;
}

public void setCheckpointDir(String checkpointDir) {
this.checkpointDir = checkpointDir;
}

public boolean isDeepCleaned() {
return deepClean;
}
Expand Down Expand Up @@ -202,10 +196,6 @@ public String getSnapshotPath() {
return snapshotPath;
}

public String getCheckpointDir() {
return checkpointDir;
}

public boolean isSstFiltered() {
return sstFiltered;
}
Expand All @@ -231,7 +221,6 @@ public SnapshotInfo.Builder toBuilder() {
.setPathPreviousSnapshotId(pathPreviousSnapshotId)
.setGlobalPreviousSnapshotId(globalPreviousSnapshotId)
.setSnapshotPath(snapshotPath)
.setCheckpointDir(checkpointDir)
.setDbTxSequenceNumber(dbTxSequenceNumber)
.setDeepClean(deepClean)
.setSstFiltered(sstFiltered)
Expand Down Expand Up @@ -260,7 +249,6 @@ public static class Builder {
private UUID pathPreviousSnapshotId;
private UUID globalPreviousSnapshotId;
private String snapshotPath;
private String checkpointDir;
private long dbTxSequenceNumber;
private boolean deepClean;
private boolean sstFiltered;
Expand Down Expand Up @@ -339,12 +327,6 @@ public Builder setSnapshotPath(String snapshotPath) {
return this;
}

/** @param checkpointDir - Snapshot checkpoint directory. */
public Builder setCheckpointDir(String checkpointDir) {
this.checkpointDir = checkpointDir;
return this;
}

/** @param dbTxSequenceNumber - RDB latest transaction sequence number. */
public Builder setDbTxSequenceNumber(long dbTxSequenceNumber) {
this.dbTxSequenceNumber = dbTxSequenceNumber;
Expand Down Expand Up @@ -459,7 +441,6 @@ public OzoneManagerProtocolProtos.SnapshotInfo getProtobuf() {
}

sib.setSnapshotPath(snapshotPath)
.setCheckpointDir(checkpointDir)
.setDbTxSequenceNumber(dbTxSequenceNumber)
.setDeepClean(deepClean);
return sib.build();
Expand Down Expand Up @@ -544,7 +525,6 @@ public static SnapshotInfo getFromProtobuf(
}

osib.setSnapshotPath(snapshotInfoProto.getSnapshotPath())
.setCheckpointDir(snapshotInfoProto.getCheckpointDir())
.setDbTxSequenceNumber(snapshotInfoProto.getDbTxSequenceNumber());

return osib.build();
Expand All @@ -562,17 +542,20 @@ public Map<String, String> toAuditMap() {
/**
* Get the name of the checkpoint directory.
*/
public static String getCheckpointDirName(UUID snapshotId) {
public static String getCheckpointDirName(UUID snapshotId, int version) {
Objects.requireNonNull(snapshotId,
"SnapshotId is needed to create checkpoint directory");
return OM_SNAPSHOT_SEPARATOR + snapshotId;
if (version == 0) {
return OM_SNAPSHOT_SEPARATOR + snapshotId;
}
return OM_SNAPSHOT_SEPARATOR + snapshotId + OM_SNAPSHOT_SEPARATOR + version;
}

/**
* Get the name of the checkpoint directory, (non-static).
*/
public String getCheckpointDirName() {
return getCheckpointDirName(getSnapshotId());
public String getCheckpointDirName(int version) {
return getCheckpointDirName(getSnapshotId(), version);
}

public long getDbTxSequenceNumber() {
Expand Down Expand Up @@ -703,10 +686,6 @@ public static SnapshotInfo newInstance(String volumeName,
.setBucketName(bucketName)
.setDeepClean(false)
.setDeepCleanedDeletedDir(false);

if (snapshotId != null) {
builder.setCheckpointDir(getCheckpointDirName(snapshotId));
}
return builder.build();
}

Expand All @@ -729,7 +708,6 @@ public boolean equals(Object o) {
Objects.equals(
globalPreviousSnapshotId, that.globalPreviousSnapshotId) &&
snapshotPath.equals(that.snapshotPath) &&
checkpointDir.equals(that.checkpointDir) &&
deepClean == that.deepClean &&
sstFiltered == that.sstFiltered &&
referencedSize == that.referencedSize &&
Expand All @@ -746,7 +724,7 @@ public int hashCode() {
return Objects.hash(snapshotId, name, volumeName, bucketName,
snapshotStatus,
creationTime, deletionTime, pathPreviousSnapshotId,
globalPreviousSnapshotId, snapshotPath, checkpointDir,
globalPreviousSnapshotId, snapshotPath,
deepClean, sstFiltered,
referencedSize, referencedReplicatedSize,
exclusiveSize, exclusiveReplicatedSize, deepCleanedDeletedDir, lastTransactionInfo, createTransactionInfo);
Expand All @@ -773,7 +751,6 @@ public String toString() {
", pathPreviousSnapshotId: '" + pathPreviousSnapshotId + '\'' +
", globalPreviousSnapshotId: '" + globalPreviousSnapshotId + '\'' +
", snapshotPath: '" + snapshotPath + '\'' +
", checkpointDir: '" + checkpointDir + '\'' +
", dbTxSequenceNumber: '" + dbTxSequenceNumber + '\'' +
", deepClean: '" + deepClean + '\'' +
", sstFiltered: '" + sstFiltered + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class TestOmSnapshotInfo {
private static final UUID GLOBAL_PREVIOUS_SNAPSHOT_ID =
PATH_PREVIOUS_SNAPSHOT_ID;
private static final String SNAPSHOT_PATH = "test/path";
private static final String CHECKPOINT_DIR = "checkpoint.testdir";
private static final long DB_TX_SEQUENCE_NUMBER = 12345L;

private SnapshotInfo createSnapshotInfo() {
Expand All @@ -60,7 +59,6 @@ private SnapshotInfo createSnapshotInfo() {
.setPathPreviousSnapshotId(PATH_PREVIOUS_SNAPSHOT_ID)
.setGlobalPreviousSnapshotId(GLOBAL_PREVIOUS_SNAPSHOT_ID)
.setSnapshotPath(SNAPSHOT_PATH)
.setCheckpointDir(CHECKPOINT_DIR)
.setDbTxSequenceNumber(DB_TX_SEQUENCE_NUMBER)
.setDeepClean(false)
.setSstFiltered(false)
Expand All @@ -86,7 +84,6 @@ private OzoneManagerProtocolProtos.SnapshotInfo createSnapshotInfoProto() {
.setPathPreviousSnapshotID(toProtobuf(PATH_PREVIOUS_SNAPSHOT_ID))
.setGlobalPreviousSnapshotID(toProtobuf(GLOBAL_PREVIOUS_SNAPSHOT_ID))
.setSnapshotPath(SNAPSHOT_PATH)
.setCheckpointDir(CHECKPOINT_DIR)
.setDbTxSequenceNumber(DB_TX_SEQUENCE_NUMBER)
.setDeepClean(false)
.setSstFiltered(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ private String createSnapshot() throws Exception {
SnapshotInfo snapshotInfo = ozoneManager.getMetadataManager()
.getSnapshotInfoTable()
.get(SnapshotInfo.getTableKey(VOLUME, BUCKET, snapshotName));
String snapshotDirName = getSnapshotPath(conf, snapshotInfo) +
String snapshotDirName = getSnapshotPath(conf, snapshotInfo, 0) +
OM_KEY_PREFIX + "CURRENT";
GenericTestUtils.waitFor(() -> new File(snapshotDirName).exists(),
1000, 100000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static void shutdown() {
}

private String getDBCheckpointAbsolutePath(SnapshotInfo snapshotInfo) {
return OmSnapshotManager.getSnapshotPath(conf, snapshotInfo);
return OmSnapshotManager.getSnapshotPath(conf, snapshotInfo, 0);
}

private static String getSnapshotDBKey(String volumeName, String bucketName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ private String createSnapshot(String vname, String bname)
writeClient.createSnapshot(vname, bname, snapshotName);
SnapshotInfo snapshotInfo = om.getMetadataManager().getSnapshotInfoTable()
.get(SnapshotInfo.getTableKey(vname, bname, snapshotName));
String snapshotPath = getSnapshotPath(conf, snapshotInfo)
String snapshotPath = getSnapshotPath(conf, snapshotInfo, 0)
+ OM_KEY_PREFIX;
GenericTestUtils.waitFor(() -> new File(snapshotPath).exists(),
100, 30000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void write(int b) throws IOException {
doCallRealMethod().when(omDbCheckpointServletMock)
.transferSnapshotData(anySet(), any(), anySet(), any(), any(), anyMap());
doCallRealMethod().when(omDbCheckpointServletMock).createAndPrepareCheckpoint(anyBoolean());
doCallRealMethod().when(omDbCheckpointServletMock).getSnapshotDirsFromDB(any());
doCallRealMethod().when(omDbCheckpointServletMock).getSnapshotDirsFromDB(any(), any(), any());
}

@ParameterizedTest
Expand Down Expand Up @@ -748,7 +748,7 @@ private void setupClusterAndMocks(String volumeName, String bucketName,
// Init the mock with the spyDbstore
doCallRealMethod().when(omDbCheckpointServletMock).initialize(any(), any(),
eq(false), any(), any(), eq(false));
doCallRealMethod().when(omDbCheckpointServletMock).getSnapshotDirsFromDB(any());
doCallRealMethod().when(omDbCheckpointServletMock).getSnapshotDirsFromDB(any(), any(), any());
omDbCheckpointServletMock.initialize(spyDbStore, om.getMetrics().getDBCheckpointMetrics(),
false,
om.getOmAdminUsernames(), om.getOmAdminGroups(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ private void checkSnapshot(OzoneManager leaderOM, OzoneManager followerOM,
File followerMetaDir = OMStorage.getOmDbDir(followerOM.getConfiguration());
Path followerActiveDir = Paths.get(followerMetaDir.toString(), OM_DB_NAME);
Path followerSnapshotDir =
Paths.get(getSnapshotPath(followerOM.getConfiguration(), snapshotInfo));
Paths.get(getSnapshotPath(followerOM.getConfiguration(), snapshotInfo, 0));
File leaderMetaDir = OMStorage.getOmDbDir(leaderOM.getConfiguration());
Path leaderActiveDir = Paths.get(leaderMetaDir.toString(), OM_DB_NAME);
Path leaderSnapshotDir =
Paths.get(getSnapshotPath(leaderOM.getConfiguration(), snapshotInfo));
Paths.get(getSnapshotPath(leaderOM.getConfiguration(), snapshotInfo, 0));

// Get list of live files on the leader.
RocksDB activeRocksDB = ((RDBStore) leaderOM.getMetadataManager().getStore())
Expand Down Expand Up @@ -1056,7 +1056,7 @@ private SnapshotInfo createOzoneSnapshot(OzoneManager leaderOM, String name)
.get(tableKey);
// Allow the snapshot to be written to disk
String fileName =
getSnapshotPath(leaderOM.getConfiguration(), snapshotInfo);
getSnapshotPath(leaderOM.getConfiguration(), snapshotInfo, 0);
File snapshotDir = new File(fileName);
if (!RDBCheckpointUtils
.waitForCheckpointDirectoryExist(snapshotDir)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ private String createSnapshot(String volName, String buckName,
.get(SnapshotInfo.getTableKey(volName, linkedBuckets.getOrDefault(buckName, buckName), snapshotName));
String snapshotDirName =
OmSnapshotManager.getSnapshotPath(ozoneManager.getConfiguration(),
snapshotInfo) + OM_KEY_PREFIX + "CURRENT";
snapshotInfo, 0) + OM_KEY_PREFIX + "CURRENT";
GenericTestUtils
.waitFor(() -> new File(snapshotDirName).exists(), 1000, 120000);
return snapshotKeyPrefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ private String createSnapshot(String snapshotName)
SnapshotInfo snapshotInfo = ozoneManager.getMetadataManager()
.getSnapshotInfoTable()
.get(SnapshotInfo.getTableKey(snapshot.getVolumeName(), snapshot.getBucketName(), snapshotName));
String snapshotDirName = getSnapshotPath(conf, snapshotInfo) +
String snapshotDirName = getSnapshotPath(conf, snapshotInfo, 0) +
OM_KEY_PREFIX + "CURRENT";
GenericTestUtils.waitFor(() -> new File(snapshotDirName).exists(),
1000, 120000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private void createSnapshot(String volName, String buckName, String snapName) th

String tableKey = SnapshotInfo.getTableKey(volName, buckName, snapName);
SnapshotInfo snapshotInfo = SnapshotUtils.getSnapshotInfo(cluster.getOMLeader(), tableKey);
String fileName = getSnapshotPath(cluster.getOMLeader().getConfiguration(), snapshotInfo);
String fileName = getSnapshotPath(cluster.getOMLeader().getConfiguration(), snapshotInfo, 0);
File snapshotDir = new File(fileName);
if (!RDBCheckpointUtils.waitForCheckpointDirectoryExist(snapshotDir)) {
throw new IOException("Snapshot directory doesn't exist");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ private void createSnapshot()
.get(SnapshotInfo.getTableKey(volumeName, bucketName, snapshotName));
// Allow the snapshot to be written to disk
String fileName =
getSnapshotPath(ozoneManager.getConfiguration(), snapshotInfo);
getSnapshotPath(ozoneManager.getConfiguration(), snapshotInfo, 0);
File snapshotDir = new File(fileName);
if (!RDBCheckpointUtils
.waitForCheckpointDirectoryExist(snapshotDir)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private String createSnapshot(String volName, String buckName,
.getSnapshotInfoTable()
.get(SnapshotInfo.getTableKey(volName, buckName, snapshotName));
String snapshotDirName = OmSnapshotManager
.getSnapshotPath(clientConf, snapshotInfo) + OM_KEY_PREFIX + "CURRENT";
.getSnapshotPath(clientConf, snapshotInfo, 0) + OM_KEY_PREFIX + "CURRENT";
GenericTestUtils.waitFor(() -> new File(snapshotDirName).exists(),
1000, 120000);
return snapshotKeyPrefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ private SnapshotInfo createOzoneSnapshot(OzoneManager leaderOM, String name) thr
.getSnapshotInfoTable()
.get(tableKey);
// Allow the snapshot to be written to disk
String fileName = getSnapshotPath(leaderOM.getConfiguration(), snapshotInfo);
String fileName = getSnapshotPath(leaderOM.getConfiguration(), snapshotInfo, 0);
File snapshotDir = new File(fileName);
if (!RDBCheckpointUtils.waitForCheckpointDirectoryExist(snapshotDir)) {
throw new IOException("snapshot directory doesn't exist");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ message SnapshotInfo {
optional hadoop.hdds.UUID pathPreviousSnapshotID = 8;
optional hadoop.hdds.UUID globalPreviousSnapshotID = 9;
optional string snapshotPath = 10;
optional string checkpointDir = 11;
optional string checkpointDir = 11 [deprecated = true];
optional int64 dbTxSequenceNumber = 12;
optional bool deepClean = 13;
optional bool sstFiltered = 14;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.apache.hadoop.ozone.lock.BootstrapStateHandler;
import org.apache.hadoop.ozone.om.helpers.SnapshotInfo;
import org.apache.hadoop.ozone.om.snapshot.OMDBCheckpointUtils;
import org.apache.hadoop.ozone.om.snapshot.OmSnapshotLocalDataManager;
import org.apache.hadoop.ozone.om.snapshot.OmSnapshotUtils;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.Time;
Expand Down Expand Up @@ -347,7 +348,8 @@ private Set<Path> getSnapshotDirs(DBCheckpoint checkpoint, boolean waitForDir)
OzoneConfiguration conf = getConf();

Set<Path> snapshotPaths = new HashSet<>();

OzoneManager om = (OzoneManager) getServletContext().getAttribute(OzoneConsts.OM_CONTEXT_ATTRIBUTE);
OmSnapshotLocalDataManager snapshotLocalDataManager = om.getOmSnapshotManager().getSnapshotLocalDataManager();
// get snapshotInfo entries
OmMetadataManagerImpl checkpointMetadataManager =
OmMetadataManagerImpl.createCheckpointMetadataManager(
Expand All @@ -359,11 +361,14 @@ private Set<Path> getSnapshotDirs(DBCheckpoint checkpoint, boolean waitForDir)
// For each entry, wait for corresponding directory.
while (iterator.hasNext()) {
Table.KeyValue<String, SnapshotInfo> entry = iterator.next();
Path path = Paths.get(getSnapshotPath(conf, entry.getValue()));
if (waitForDir) {
waitForDirToExist(path);
try (OmSnapshotLocalDataManager.ReadableOmSnapshotLocalDataMetaProvider snapMetaProvider =
snapshotLocalDataManager.getOmSnapshotLocalDataMeta(entry.getValue())) {
Path path = Paths.get(getSnapshotPath(conf, entry.getValue(), snapMetaProvider.getMeta().getVersion()));
if (waitForDir) {
waitForDirToExist(path);
}
snapshotPaths.add(path);
}
snapshotPaths.add(path);
}
} finally {
checkpointMetadataManager.stop();
Expand Down
Loading