Skip to content

Commit

Permalink
HDDS-10696. Fixed ozone integration test fails because of empty snaps…
Browse files Browse the repository at this point in the history
…hot installation
  • Loading branch information
hemantk-12 committed May 8, 2024
1 parent 587d0aa commit 900ac07
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.hadoop.hdds.utils.DBCheckpointServlet;
import org.apache.hadoop.hdds.utils.db.DBCheckpoint;
import org.apache.hadoop.hdds.utils.db.RDBCheckpointUtils;
import org.apache.hadoop.hdds.utils.db.RDBStore;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.hdds.utils.db.TableIterator;
import org.apache.hadoop.ozone.OzoneConsts;
Expand Down Expand Up @@ -317,8 +318,7 @@ private boolean getFilesForArchive(DBCheckpoint checkpoint,

// Get the snapshot files.
Set<Path> snapshotPaths = waitForSnapshotDirs(checkpoint);
Path snapshotDir = Paths.get(OMStorage.getOmDbDir(getConf()).toString(),
OM_SNAPSHOT_DIR);
Path snapshotDir = Paths.get(getSnapshotsParentDir()).getParent();
if (!processDir(snapshotDir, copyFiles, hardLinkFiles, sstFilesToExclude,
snapshotPaths, excluded, copySize, null)) {
return false;
Expand Down Expand Up @@ -635,6 +635,12 @@ private OzoneConfiguration getConf() {
.getConfiguration();
}

private String getSnapshotsParentDir() {
OzoneManager om = (OzoneManager) getServletContext().getAttribute(OzoneConsts.OM_CONTEXT_ATTRIBUTE);
RDBStore store = (RDBStore) om.getMetadataManager().getStore();
return store.getSnapshotsParentDir();
}

@Override
public BootstrapStateHandler.Lock getBootstrapStateLock() {
return lock;
Expand Down

0 comments on commit 900ac07

Please sign in to comment.