Skip to content

Commit 9c8251e

Browse files
committed
Added a comment and renamed the function
1 parent 83113f7 commit 9c8251e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServlet.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ private boolean getFilesForArchive(DBCheckpoint checkpoint,
318318

319319
// Get the snapshot files.
320320
Set<Path> snapshotPaths = waitForSnapshotDirs(checkpoint);
321-
Path snapshotDir = Paths.get(getSnapshotsParentDir()).getParent();
321+
Path snapshotDir = getSnapshotDir();
322322
if (!processDir(snapshotDir, copyFiles, hardLinkFiles, sstFilesToExclude,
323323
snapshotPaths, excluded, copySize, null)) {
324324
return false;
@@ -635,10 +635,13 @@ private OzoneConfiguration getConf() {
635635
.getConfiguration();
636636
}
637637

638-
private String getSnapshotsParentDir() {
638+
private Path getSnapshotDir() {
639639
OzoneManager om = (OzoneManager) getServletContext().getAttribute(OzoneConsts.OM_CONTEXT_ATTRIBUTE);
640640
RDBStore store = (RDBStore) om.getMetadataManager().getStore();
641-
return store.getSnapshotsParentDir();
641+
// store.getSnapshotsParentDir() returns path to checkpointState (e.g. <om-data-dir>db.snapshots/checkpointState)
642+
// But we need to return path till db.snapshots which contains checkpointState and diffState.
643+
// So that whole snapshots and compaction information can be transfer to follower.
644+
return Paths.get(store.getSnapshotsParentDir()).getParent();
642645
}
643646

644647
@Override

0 commit comments

Comments
 (0)