Skip to content
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

Merged
merged 10 commits into from
Dec 22, 2020

Conversation

bharatviswa504
Copy link
Contributor

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.

@bharatviswa504
Copy link
Contributor Author

bharatviswa504 commented Dec 11, 2020

Thank You @hanishakoneru for the offline discussion.
I have posted the PR, as discussed to solve the issue for fresh insatllation and also for upgrades.

Copy link
Contributor

@hanishakoneru hanishakoneru left a 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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")) {
Copy link
Contributor

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().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@hanishakoneru
Copy link
Contributor

Thanks Bharat for updating the patch.
We can use the Const OM_RATIS_SNAPSHOT_DIR in OzoneManagerRatisServer#getOMRatisSnapshotDirectory() also.

I am +1 with that fixed. Thanks.

@bharatviswa504
Copy link
Contributor Author

Thank You @hanishakoneru for the review. Fixed it.

@bharatviswa504 bharatviswa504 merged commit 7f36990 into apache:master Dec 22, 2020
@bharatviswa504
Copy link
Contributor Author

Thank You @hanishakoneru for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants