Skip to content

HBASE-23202 ExportSnapshot (import) will fail if copying files to root directory takes longer than cleaner TTL - #769

Closed
guangxuCheng wants to merge 1 commit into
apache:masterfrom
guangxuCheng:HBASE-23202
Closed

HBASE-23202 ExportSnapshot (import) will fail if copying files to root directory takes longer than cleaner TTL#769
guangxuCheng wants to merge 1 commit into
apache:masterfrom
guangxuCheng:HBASE-23202

Conversation

@guangxuCheng

Copy link
Copy Markdown
Member

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 36sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
💚mvninstall6m 0smaster passed
💚compile1m 1smaster passed
💚checkstyle1m 37smaster passed
💚shadedjars5m 35sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 40smaster passed
💙spotbugs4m 36sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs4m 34smaster passed
_ Patch Compile Tests _
💚mvninstall5m 45sthe patch passed
💚compile0m 57sthe patch passed
💚javac0m 57sthe patch passed
💔checkstyle1m 18shbase-server: The patch generated 2 new + 5 unchanged - 0 fixed = 7 total (was 5)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 49spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 52sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 36sthe patch passed
💚findbugs4m 12sthe patch passed
_ Other Tests _
💚unit160m 36shbase-server in the patch passed.
💚asflicense0m 35sThe patch does not generate ASF License warnings.
220m 59s
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/artifact/out/Dockerfile
GITHUB PR#769
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 228abb5f3da1 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-769/out/precommit/personality/provided.sh
git revisionmaster / 4c75485
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/artifact/out/diff-checkstyle-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/testReport/
Max. process+thread count4611 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

Comment on lines +272 to +279
try {
snapshotInProgress.addAll(fileInspector.filesUnderSnapshot(run.getPath()));
} catch (CorruptedSnapshotException e) {
// See HBASE-16464
if (e.getCause() instanceof FileNotFoundException) {
// If the snapshot is corrupt, we will delete it
fs.delete(run.getPath(), true);
LOG.warn("delete the " + run.getPath() + " due to exception:", e.getCause());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this actually work for the ExportSnapshot case? The snapshot manifest is added to tmp before all the files are present on cluster so it looks like this will delete the snapshot manifest which would mess up the import job.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Hmmm, there maybe race condition between ExportSnapshot and SnapshotCleaner.
Copying Snapshot Manifest is a fast operation. Maybe we can add a time threshold. When we catch CorruptedSnapshotException, if the modification time of the snapshot folder exceeds a certain time threshold, we will delete it, otherwise we will ignore this cleanup operation. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

copying the snapshot manifest is not always fast since it can be hundreds of MB and the link between clusters can be poor.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and when the snapshot contains a large number of files, copying the snapshot can take a long time even when there isn't a lot of data. Also copying the actual data for a large export can take tens-of-days.

@guangxuChengguangxuChengOct 30, 2019

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

In fact, when CorruptedSnapshotException is thrown, we can ignore the exception and continue to clean up HFile instead of skip.

If the CorruptedSnapshotException is thrown, which means that the ExportSnapshot has not copy the snapshot manifest successfully, and the data file of the snapshot has not yet started to copy, so it will have no effect on the snapshot if the snapshotCleaner continues.

The main purpose of adding a delete snapshot manifest logic is to clean up the abnormal snapshot manifest. Of course, it is OK to remove the logic.

@eomikseomiksMar 27, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any progress on this issue review?? I faced exactly same problem, and hope it to be resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, if it reads into the middle of copying manifest files, it is ok to remove this snapshot as copying HFiles has not started yet. So there is no impact for the logic in snapshotCleaner.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The logic of getUnreferencedFiles() is that for an HFile which is not in cache, it will refreshCache to get the latest snapshot hfiles. If one hfile from this exortSnapshot job is in the list, this means that manifest files have been copied over, so refreshCache() will get the latest snapshot file list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@busbey@z-york Unless you see something missing, I think this one is good to go, thanks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I rebased the patch and posted a new pull request,
#1791

It is same as the original one, except some minor changes (like some of utilities are moved, change to use new utility class).

@binlijin

Copy link
Copy Markdown
Contributor

LGTM

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec1m 6sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
💚mvninstall5m 53smaster passed
💚compile0m 57smaster passed
💚checkstyle1m 29smaster passed
💚shadedjars5m 3sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 37smaster passed
💙spotbugs4m 32sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs4m 28smaster passed
_ Patch Compile Tests _
💚mvninstall5m 25sthe patch passed
💚compile0m 59sthe patch passed
💚javac0m 59sthe patch passed
💔checkstyle1m 27shbase-server: The patch generated 3 new + 5 unchanged - 0 fixed = 8 total (was 5)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 58spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 18sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 36sthe patch passed
💚findbugs4m 36sthe patch passed
_ Other Tests _
💔unit31m 18shbase-server in the patch failed.
💚asflicense0m 15sThe patch does not generate ASF License warnings.
93m 15s
ReasonTests
Failed junit testshadoop.hbase.master.snapshot.TestSnapshotHFileCleaner
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/2/artifact/out/Dockerfile
GITHUB PR#769
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux a0bf09f39b92 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-769/out/precommit/personality/provided.sh
git revisionmaster / 2451c2c
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/2/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/2/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/2/testReport/
Max. process+thread count672 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/2/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec1m 13sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
💚mvninstall5m 55smaster passed
💚compile0m 58smaster passed
💚checkstyle1m 28smaster passed
💚shadedjars5m 0sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 40smaster passed
💙spotbugs5m 7sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 4smaster passed
_ Patch Compile Tests _
💚mvninstall6m 22sthe patch passed
💚compile1m 7sthe patch passed
💚javac1m 7sthe patch passed
💚checkstyle1m 30sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 14spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 37sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 34sthe patch passed
💚findbugs4m 36sthe patch passed
_ Other Tests _
💚unit227m 43shbase-server in the patch passed.
💚asflicense0m 26sThe patch does not generate ASF License warnings.
292m 20s
SubsystemReport/Notes
DockerClient=19.03.4 Server=19.03.4 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/3/artifact/out/Dockerfile
GITHUB PR#769
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux b545485db603 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-769/out/precommit/personality/provided.sh
git revisionmaster / 2451c2c
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/3/testReport/
Max. process+thread count4407 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/3/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@ferhui

Copy link
Copy Markdown

Face the same problem. Any progress on this issue? @guangxuCheng@binlijin

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 4s#769 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#769
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 3s#769 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#769
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 2s#769 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#769
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 3s#769 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#769
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 2s#769 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#769
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 3s#769 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#769
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-769/1/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@huaxiangsun

Copy link
Copy Markdown
Contributor

We run into this issue when exportSnapshot with large size hfiles, will spend some time on reviewing.

@huaxiangsunhuaxiangsun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, will try to rebase and run test locally.

Sign up for freeto 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.

9 participants

@guangxuCheng@Apache-HBase@binlijin@ferhui@huaxiangsun@busbey@z-york@eomiks@Apache9