-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-3378. OzoneManager group init failed because of incorrect snapshot directory location. #1688
Conversation
Thank You @hanishakoneru for the offline discussion. |
30dcd99
to
3a2be63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bharatviswa504 for fixing this.
Patch LGTM overall. I have minor comments.
for (File dir : dirs) { | ||
if (dir.isDirectory() && dir.getName().equals("snapshot")) { | ||
FileUtils.moveDirectory(dir.toPath(), omRatisSnapshotDir.toPath()); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of listing the files and trying to find if snapshot subdir exists, why don't we construct the snapshot subdir path and check it that exists and move it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it can be, thanks for the suggestion updated it.
|
||
if (dirs != null) { | ||
for (File dir : dirs) { | ||
if (dir.isDirectory() && dir.getName().equals("snapshot")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define "snapshot" as a constant in OzoneConsts and use that here and in getOMRatisSnapshotDirectory().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks Bharat for updating the patch. I am +1 with that fixed. Thanks. |
Thank You @hanishakoneru for the review. Fixed it. |
Thank You @hanishakoneru for the review. |
What changes were proposed in this pull request?
Make ratis.snapshot.dir do not depend on ozone.om.ratis.storage.dir, so that ozone.om.ratis.storage.dir does not have any other directories.
And also if ratis.storage.dir is not defined, the default we fall back to ozone.metadata.dirs, then we will have ratis.storage.dir as ozone.metadata.dirs + "/ratis".
And for older clusters, the directory will be moved to new ratis.snapshot.dir, if snapshot directory exists in ozone.om.ratis.storage.dir.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-3378
Please replace this section with the link to the Apache JIRA)
How was this patch tested?
Existing tests.