-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-8968. [Snapshot] Distcp using snapshots fails due to incorrect toSnapshot name. #5040
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
Conversation
ayushtkn
left a comment
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.
I doubt around the existing code itself, why this check and takeTemporarySnapshot stuff is there only for toSnapshot, but not for fromSnapshot?
In HDFS
getSnapshotDiffReport(dir, "", "s1");
is a valid case AFAIK, Distcp also has rdiff which would create issue in similar situation if fromSnapshot stuff isn't handled.
distcp has specific checks as well for fromSnapshot to be current dir
https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpSync.java#L132-L139
Thanks @ayushtkn for the review , updated the patch. |
ayushtkn
left a comment
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.
Minor stuff, rest looks good
...one/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
...one/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
...onefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
...onefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
...one/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
Show resolved
Hide resolved
sumitagrawl
left a comment
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.
@sadanand48 Given few minor comments, please check
...one/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
Show resolved
Hide resolved
...onefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
| // & the toSnapshot | ||
| takeTemporaryFromSnapshot = true; | ||
| fromSnapshot = createSnapshot(snapshotDir.toString(), | ||
| "temp" + "-from-" + SnapshotInfo.generateName(Time.now())); |
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.
if multiple snapshot diff running, can this still be unique?
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.
updated code using uuid now.
ayushtkn
left a comment
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.
I don't have anything further. So, once the build & others are happy, it is good from my side.
Changes LGTM
sumitagrawl
left a comment
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.
@sadanand48 LGTM +1
| OzoneFSUtils.generateUniqueTempSnapshotName()); | ||
| } | ||
| if (fromSnapshot.isEmpty()) { | ||
| // empty fromSnapshot implies diff b/w the current state |
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.
@sadanand48 we don't support snapshot diff b/w snapshots where fromSnapshot is more recent than toSnapshot? Is there a use case for this?
What changes were proposed in this pull request?
Distcp using snapshots fails due to incorrect toSnapshot name. The string used to represent current FS state should be an empty string instead of "."
Check https://github.com/apache/hadoop/blob/4e699f0383590d6c72cb3ee2294da29a4945922f/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpSync.java#L373 for reference.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8968
How was this patch tested?
Tested manually