Skip to content

HBASE-26323 introduce a SnapshotProcedure - #3716

Closed
frostruan wants to merge 5 commits into
apache:masterfrom
frostruan:HBASE-26323
Closed

HBASE-26323 introduce a SnapshotProcedure#3716
frostruan wants to merge 5 commits into
apache:masterfrom
frostruan:HBASE-26323

Conversation

@frostruan

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 25sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗prototool0m 0sprototool was not available.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall3m 57smaster passed
+1 💚compile5m 34smaster passed
+1 💚checkstyle1m 50smaster passed
+1 💚spotbugs7m 3smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall3m 39sthe patch passed
+1 💚compile5m 35sthe patch passed
+1 💚cc5m 35sthe patch passed
+1 💚javac5m 35sthe patch passed
-0 ⚠️checkstyle0m 31shbase-client: The patch generated 1 new + 186 unchanged - 0 fixed = 187 total (was 186)
-0 ⚠️checkstyle1m 7shbase-server: The patch generated 23 new + 157 unchanged - 1 fixed = 180 total (was 158)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck18m 32sPatch does not cause any errors with Hadoop 3.1.2 3.2.1 3.3.0.
+1 💚hbaseprotoc2m 4sthe patch passed
-1 ❌spotbugs2m 20shbase-server generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
_ Other Tests _
+1 💚asflicense0m 38sThe patch does not generate ASF License warnings.
68m 3s
ReasonTests
FindBugsmodule:hbase-server
Inconsistent synchronization of org.apache.hadoop.hbase.master.procedure.ServerRemoteProcedure.dispatched; locked 60% of time Unsynchronized access at SnapshotVerifyProcedure.java:60% of time Unsynchronized access at SnapshotVerifyProcedure.java:[line 97]
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#3716
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool
unameLinux 4321f64144be 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f65b769
Default JavaAdoptOpenJDK-1.8.0_282-b08
checkstylehttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-client.txt
checkstylehttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
spotbugshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-general-check/output/new-spotbugs-hbase-server.html
Max. process+thread count96 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 27sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for branch
+1 💚mvninstall3m 55smaster passed
+1 💚compile2m 15smaster passed
+1 💚shadedjars8m 19sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 15smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for patch
+1 💚mvninstall3m 45sthe patch passed
+1 💚compile2m 13sthe patch passed
+1 💚javac2m 13sthe patch passed
+1 💚shadedjars8m 13spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 13sthe patch passed
_ Other Tests _
+1 💚unit0m 47shbase-protocol-shaded in the patch passed.
+1 💚unit1m 18shbase-client in the patch passed.
-1 ❌unit149m 34shbase-server in the patch failed.
186m 38s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#3716
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 295faa7231f2 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f65b769
Default JavaAdoptOpenJDK-1.8.0_282-b08
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/testReport/
Max. process+thread count4712 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 58sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall5m 2smaster passed
+1 💚compile2m 52smaster passed
+1 💚shadedjars9m 13sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 21smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall4m 51sthe patch passed
+1 💚compile2m 53sthe patch passed
+1 💚javac2m 53sthe patch passed
+1 💚shadedjars9m 11spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 19sthe patch passed
_ Other Tests _
+1 💚unit1m 3shbase-protocol-shaded in the patch passed.
+1 💚unit1m 43shbase-client in the patch passed.
-1 ❌unit206m 44shbase-server in the patch failed.
250m 0s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#3716
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 41f7283ebf47 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f65b769
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/testReport/
Max. process+thread count2919 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9Apache9 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.

This is a good start.

Overall the approach is good. I think you should have learned a lot on on proc-v2 and am-v2 @frostruan . It is not an easy work. Really appreciate on your effect.

Left some comments, let's work together to get this done. There are some high level questions:

  1. How to prevent split/merge at the same time when the SnapshotProcedure only takes shared lock on the table?
  2. Why do we let client specify whether to use zk coordination?
  3. The RemoteProcedureRequest is not enough for snapshot request? It is designed to be general usage.

Comment threadhbase-protocol-shaded/src/main/protobuf/server/master/Master.proto Outdated
Comment threadhbase-protocol-shaded/src/main/protobuf/server/master/Master.proto Outdated
repeated OpenRegionRequest open_region = 1;
repeated CloseRegionRequest close_region = 2;
repeated RemoteProcedureRequest proc = 3;
repeated SnapshotRegionRequest snapshot_region = 4;

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.

It can not be implemented as a RemoteProcedure?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

ok. Do you think if we can introduce a snapshotTable method in region server for master to snapshot online regions?

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.

You can see the current implementation for some remote procedures. They just use the same executeProcedures method for sending from master to region server. The RemoteProcedureRequest has a class name field for creating it using reflection. You can implement the logic of snapshot in the created class.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for your reply. @Apache9

I think we have three options to implement snapshot logic here.
option a. using a RegionRemoteProcedure to implement region related operations, like open, close, snapshot and flush. That's my choice in the first commit.
option b. using a ServerRemoteProcedure to snapshot regions (or just a single region) in a remote server, like log splitting or claim replication queue. That's my choice for snapshot verifying. I think this is what you recommend.
option c. we introduce a new method snapshotRegion in Admin.proto for RegionServerAdmin, and give it admin priority just like flush region and log roll. for master, we just throw unsupported exception.

Sorry I misunderstood what you say "It can not be implemented as a RemoteProcedure?". I thought you mean "we shouldn't using remote procedure to implement this". so I changed from option a to option c.

Of course we can implement snapshot with ServerRemoteProcedure. Actually I think it makes easier to snapshot regions because we don't need to modify RSProcedureDispatcher to introduce a new kind of region operation. I will try to fix this as soon as possible. Thank you.

// but we may need to downgrade it to shared lock for some reasons:
// a. exclusive lock has a negative effect on assigning region. See HBASE-21480 for details.
// b. we want to support taking multiple different snapshots on same table on the same time.
if (env.getProcedureScheduler().waitTableSharedLock(this, getTableName())) {

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.

Is this enough? The SplitTableRegionProcedure and MergeTableRegionsProcedure also take shared lock on table, so taking shared lock can not prevent split/merge at the same time.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for reviewing @Apache9 . Yes, shared table lock is not enough, so there is some extra work in SnapshotManager. Before SplitTableRegionProcedure/MergeTableRegionsProcedure runs, they will check if the table is in snapshot. If table is in snapshot, the procedure will stop. In SnapshotManager, we have a map whose key is SnapshotDescription and value is SnapshotProcedure id. The map will be rebuild when master restarts. Would you mind taking a look on those?

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.

But what if a merge or a split is already on going when we want to start snapshot here?

throw new UnsupportedOperationException("unhandled state=" + state);
}
} catch (Exception e) {
if (e instanceof CorruptedSnapshotException) {

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.

Better add this catch to the specific state? We will jump to the beginning of the procedure, I do not think we can do this in later states?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, a new specific state would be better. I will try to fix it. Thanks for your advise @Apache9

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

When snapshot is corrupted, I just mark the state of procedure as FAILED and rollback the procedure. Do you think if we can make the procedure retryable like SplitWALProcedure or SyncReplicationReplayWALProcedure? @Apache9

new MasterSnapshotVerifier(env.getMasterServices(), snapshot, workingDirFS);

if (numRegions >= verifyThreshold) {
verifier.verifySnapshot(false);

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.

We do not need to create the verifier for this case?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

sorry, code here is a little confusing. let me try to explain this.

There are four parts in snapshot verifying.
a. verify snapshot descriptor.
b. verify table descriptor.
c. verify region count and region info.
d. verify store fils.

For large table snapshot, most time will be spent on verifying region info and store files. The SnapshotVerifyProcedure was designed to only verify region info and store files, so here I create a master verifier to verify snapshot descriptor, table descriptor and region count.

Sure, we can let SnapshotVerifyProcedure do this work also. I will fix it. Thanks for your advise @Apache9 .

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 29sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗prototool0m 1sprototool was not available.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for branch
+1 💚mvninstall4m 23smaster passed
+1 💚compile7m 9smaster passed
+1 💚checkstyle2m 47smaster passed
+1 💚spotbugs8m 52smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall4m 5sthe patch passed
+1 💚compile7m 14sthe patch passed
+1 💚cc7m 14sthe patch passed
+1 💚javac7m 14sthe patch passed
-0 ⚠️checkstyle1m 12shbase-server: The patch generated 8 new + 160 unchanged - 1 fixed = 168 total (was 161)
-0 ⚠️rubocop0m 13sThe patch generated 10 new + 394 unchanged - 0 fixed = 404 total (was 394)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck20m 32sPatch does not cause any errors with Hadoop 3.1.2 3.2.1 3.3.0.
+1 💚hbaseprotoc2m 59sthe patch passed
-1 ❌spotbugs2m 28shbase-server generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
_ Other Tests _
+1 💚asflicense0m 53sThe patch does not generate ASF License warnings.
83m 30s
ReasonTests
FindBugsmodule:hbase-server
Inconsistent synchronization of org.apache.hadoop.hbase.master.procedure.ServerRemoteProcedure.dispatched; locked 60% of time Unsynchronized access at SnapshotVerifyProcedure.java:60% of time Unsynchronized access at SnapshotVerifyProcedure.java:[line 103]
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#3716
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool rubocop
unameLinux b7fb50e599fa 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b94188f
Default JavaAdoptOpenJDK-1.8.0_282-b08
checkstylehttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
rubocophttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-general-check/output/diff-patch-rubocop.txt
spotbugshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-general-check/output/new-spotbugs-hbase-server.html
Max. process+thread count86 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2 rubocop=0.80.0
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 27sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 26sMaven dependency ordering for branch
+1 💚mvninstall3m 36smaster passed
+1 💚compile3m 9smaster passed
+1 💚shadedjars8m 22sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc2m 1smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for patch
+1 💚mvninstall3m 39sthe patch passed
+1 💚compile3m 8sthe patch passed
+1 💚javac3m 8sthe patch passed
+1 💚shadedjars8m 14spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc2m 1sthe patch passed
_ Other Tests _
+1 💚unit0m 46shbase-protocol-shaded in the patch passed.
+1 💚unit1m 19shbase-client in the patch passed.
-1 ❌unit149m 39shbase-server in the patch failed.
+1 💚unit6m 39shbase-thrift in the patch passed.
+1 💚unit7m 20shbase-shell in the patch passed.
204m 15s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#3716
Optional Testsjavac javadoc unit shadedjars compile
unameLinux f3e469a50f0d 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b94188f
Default JavaAdoptOpenJDK-1.8.0_282-b08
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/testReport/
Max. process+thread count5055 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 17sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 29sMaven dependency ordering for branch
+1 💚mvninstall5m 21smaster passed
+1 💚compile4m 16smaster passed
+1 💚shadedjars9m 11sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc2m 34smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall5m 1sthe patch passed
+1 💚compile4m 14sthe patch passed
+1 💚javac4m 14sthe patch passed
+1 💚shadedjars9m 12spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc2m 34sthe patch passed
_ Other Tests _
+1 💚unit1m 3shbase-protocol-shaded in the patch passed.
+1 💚unit1m 41shbase-client in the patch passed.
-1 ❌unit205m 37shbase-server in the patch failed.
+1 💚unit8m 27shbase-thrift in the patch passed.
+1 💚unit7m 2shbase-shell in the patch passed.
270m 57s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#3716
Optional Testsjavac javadoc unit shadedjars compile
unameLinux b6b1bf107d68 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b94188f
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/testReport/
Max. process+thread count3538 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 3sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+0 🆗prototool0m 0sprototool was not available.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 32sMaven dependency ordering for branch
+1 💚mvninstall4m 21smaster passed
+1 💚compile7m 12smaster passed
+1 💚checkstyle2m 47smaster passed
+1 💚spotbugs8m 57smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall4m 15sthe patch passed
+1 💚compile7m 19sthe patch passed
+1 💚cc7m 19sthe patch passed
+1 💚javac7m 19sthe patch passed
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-protocol-shaded
+1 💚checkstyle0m 32sThe patch passed checkstyle in hbase-client
+1 💚checkstyle1m 12shbase-server: The patch generated 0 new + 123 unchanged - 2 fixed = 123 total (was 125)
+1 💚checkstyle0m 47sThe patch passed checkstyle in hbase-thrift
+1 💚checkstyle0m 10sThe patch passed checkstyle in hbase-shell
-0 ⚠️rubocop0m 14sThe patch generated 10 new + 394 unchanged - 0 fixed = 404 total (was 394)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck21m 30sPatch does not cause any errors with Hadoop 3.1.2 3.2.1 3.3.0.
+1 💚hbaseprotoc3m 0sthe patch passed
-1 ❌spotbugs2m 25shbase-server generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
_ Other Tests _
+1 💚asflicense0m 54sThe patch does not generate ASF License warnings.
84m 55s
ReasonTests
FindBugsmodule:hbase-server
Inconsistent synchronization of org.apache.hadoop.hbase.master.procedure.ServerRemoteProcedure.dispatched; locked 60% of time Unsynchronized access at SnapshotVerifyProcedure.java:60% of time Unsynchronized access at SnapshotVerifyProcedure.java:[line 104]
Useless object stored in variable serverNames of method org.apache.hadoop.hbase.master.snapshot.TakeSnapshotHandler.process() At TakeSnapshotHandler.java:serverNames of method org.apache.hadoop.hbase.master.snapshot.TakeSnapshotHandler.process() At TakeSnapshotHandler.java:[line 205]
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#3716
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool rubocop
unameLinux 9c3d4fa70583 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ff11f11
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-general-check/output/diff-patch-rubocop.txt
spotbugshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-general-check/output/new-spotbugs-hbase-server.html
Max. process+thread count86 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2 rubocop=0.80.0
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 26sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for branch
+1 💚mvninstall4m 5smaster passed
+1 💚compile3m 15smaster passed
+1 💚shadedjars8m 20sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc2m 5smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for patch
+1 💚mvninstall3m 52sthe patch passed
+1 💚compile3m 12sthe patch passed
+1 💚javac3m 12sthe patch passed
+1 💚shadedjars8m 18spatch has no errors when building our shaded downstream artifacts.
-0 ⚠️javadoc0m 39shbase-server generated 2 new + 21 unchanged - 0 fixed = 23 total (was 21)
_ Other Tests _
+1 💚unit0m 46shbase-protocol-shaded in the patch passed.
+1 💚unit1m 21shbase-client in the patch passed.
-1 ❌unit149m 45shbase-server in the patch failed.
+1 💚unit6m 39shbase-thrift in the patch passed.
+1 💚unit7m 17shbase-shell in the patch passed.
205m 3s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#3716
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 6f0fee034687 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ff11f11
Default JavaAdoptOpenJDK-1.8.0_282-b08
javadochttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-jdk8-hadoop3-check/output/diff-javadoc-javadoc-hbase-server.txt
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/testReport/
Max. process+thread count3611 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 2sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 30sMaven dependency ordering for branch
+1 💚mvninstall5m 7smaster passed
+1 💚compile3m 57smaster passed
+1 💚shadedjars9m 10sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc2m 34smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall5m 1sthe patch passed
+1 💚compile3m 58sthe patch passed
+1 💚javac3m 58sthe patch passed
+1 💚shadedjars9m 11spatch has no errors when building our shaded downstream artifacts.
-0 ⚠️javadoc0m 43shbase-server generated 2 new + 86 unchanged - 0 fixed = 88 total (was 86)
_ Other Tests _
+1 💚unit1m 5shbase-protocol-shaded in the patch passed.
+1 💚unit1m 44shbase-client in the patch passed.
+1 💚unit204m 43shbase-server in the patch passed.
+1 💚unit8m 29shbase-thrift in the patch passed.
+1 💚unit7m 1shbase-shell in the patch passed.
268m 55s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#3716
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 78d4a7da458f 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ff11f11
Default JavaAdoptOpenJDK-11.0.10+9
javadochttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/artifact/yetus-jdk11-hadoop3-check/output/diff-javadoc-javadoc-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/testReport/
Max. process+thread count2497 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3716/3/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9Apache9 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.

Haven't finished reviewing the whole patch. It is so big...

The overall architecture is very good. But maybe there are still points which I haven't fully understand.

Need to discuss more.

// but we may need to downgrade it to shared lock for some reasons:
// a. exclusive lock has a negative effect on assigning region. See HBASE-21480 for details.
// b. we want to support taking multiple different snapshots on same table on the same time.
if (env.getProcedureScheduler().waitTableSharedLock(this, getTableName())) {

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.

But what if a merge or a split is already on going when we want to start snapshot here?

status.markComplete("Snapshot " + snapshot.getName() + " completed");
}

private void snapshotOfflineRegions(MasterProcedureEnv env) throws IOException {

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.

OK, so this is for snapshoting split parent. Better just name it snapshotSplitParentRegions, offline is a bit confusing here.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Really missed this case. Thanks for reminding me. Split/Merge Procedure and Snapshot Procedure, these two procedures should check whether the other is executing before starting execution. Now we only check snapshot procedure before running Split/Merge Procedure. I will try to fix this.

@Override
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException {
super.serializeStateData(serializer);
serializer.serialize(SnapshotProcedureStateData

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.

We do not serialize snapshotManifest here? Then how do we restore it when recovery?

@Override
protected void afterReplay(MasterProcedureEnv env) {
try {
prepareSnapshot(env);

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.

OK, so the trick is here, we will call parepareSnapshot to restore snapshot manifest.

try {
prepareSnapshot(env);
} catch (IOException e) {
LOG.error("Failed replaying {}, mark procedure as failed", this, e);

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.

OK, so the rollback here is very simple, just delete the snapshot directory, so we are safe to mark it as failure at any time, no PONR, good.

dispatched = false;
}

RegionStates regionStates = env.getAssignmentManager().getRegionStates();

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.

What if the table is disabled? We will not use SnapshotProcedure for disabled table?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

If table is disabled, we will derectly jump into state SNAPSHOT_SNAPSHOT_OFFLINE_REGIONS. However I didn't make disabled table snapshot distributed, just do the work on master side. It may be slow but it will not hurt the availability if table is disabled.
What do you think ?

@Override
protected void complete(MasterProcedureEnv env, Throwable error) {
if (error != null) {
Throwable realError = error.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.

Why we need this trick here? We will always wrap the actual exception?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yes, on the master side we will wrap this into a RemoteProcedureException.

}

private Optional<ServerName> newTargetServer(MasterProcedureEnv env) {
List<ServerName> onlineServers =

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.

We have implemented a ReservoirSample class in hbase-common, you can this this class to do random selection, without copying all the online servers out.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Ok. I will fix it. Thank you.

@frostruan

Copy link
Copy Markdown
ContributorAuthor

Really thanks for taking time review this PR. I am very happy to see someone still paying attention to this. @Apache9

Recently I realized that some of my previous ideas are problematic. For example

  1. The execution of state SNAPSHOT_CONSOLIDATE_SNAPSHOT in SnapshotProcedure is not idempotent.
  2. If the snapshot is corrupted, the SnapshotVerifyProcedure will get the parent SnapshotPRocedure and mark parent procedure Failed. This may be not ProcedureV2 style (I am not sure, maybe we can implement this in a better way)

I have to say that this work is more complicated than I expected. I should post a design document first and split it into some sub tasks. This PR was submitted a little too early. I will post a design doc as soon as possible. Thanks again. @Apache9

@Apache9

Copy link
Copy Markdown
Contributor

It will be good to have a design doc first~

@frostruan

frostruan commented Nov 28, 2021

Copy link
Copy Markdown
ContributorAuthor

hi @Apache9

here is a simple doc, would you mind taking a look ?

https://docs.google.com/document/d/1Il_PB1SenXGr1-mmCIWEogxEMeGZe2fpuN3bMbjqiGI/edit

@Apache9

Copy link
Copy Markdown
Contributor

hi @Apache9

here is a simple doc, would you mind taking a look ?

https://docs.google.com/document/d/1Il_PB1SenXGr1-mmCIWEogxEMeGZe2fpuN3bMbjqiGI/edit

Suggest you send an email to the dev list to let more people review the design doc~

@frostruan

Copy link
Copy Markdown
ContributorAuthor

hi @Apache9
here is a simple doc, would you mind taking a look ?
https://docs.google.com/document/d/1Il_PB1SenXGr1-mmCIWEogxEMeGZe2fpuN3bMbjqiGI/edit

Suggest you send an email to the dev list to let more people review the design doc~

ok. Thank you very much.

@frostruan
frostruan deleted the HBASE-26323 branch December 5, 2021 14:57
@frostruan

Copy link
Copy Markdown
ContributorAuthor

hi @Apache9
here is a simple doc, would you mind taking a look ?
https://docs.google.com/document/d/1Il_PB1SenXGr1-mmCIWEogxEMeGZe2fpuN3bMbjqiGI/edit

Suggest you send an email to the dev list to let more people review the design doc~

hi @Apache9
I followed your suggestion and send an email to dev@hbase.apache.org using my qq mailbox and gmail mailbox respectively, but it seems that something went wrong and the email was not sent successfully. Do you have any suggestions that can help me find out the reason ?

Thanks.

@Apache9

Copy link
Copy Markdown
Contributor

Have you subscribed to the mailing list?

@frostruan

Copy link
Copy Markdown
ContributorAuthor

Have you subscribed to the mailing list?

yes. And here is the email I sent .....

image

@Apache9

Copy link
Copy Markdown
Contributor

Strange...

@frostruan

Copy link
Copy Markdown
ContributorAuthor

never mind. I'll try other ways. Really thanks for your suggestions. @Apache9

@frostruan

Copy link
Copy Markdown
ContributorAuthor

Is it because only committers have the authority to send dev@hbase.apache.org emails? As a user, should I send emails to user@hbase.apache.org ?

@Apache9

Copy link
Copy Markdown
Contributor

No, there is no such limitation. The only possible condition is whether you have subscribed to the mailing list...

Anyway, you could send the content to me first and then I can help posting it to the mailing-list...

Thanks

@frostruan

Copy link
Copy Markdown
ContributorAuthor

Really thanks for your patience @Apache9 . anyway, I want to say

Hi all,

As we all know, currently the snapshot in hbase has a few limitations, so I want to propose a proc-v2 implementation of snapshot.

Here are some related links.

jira
https://issues.apache.org/jira/browse/HBASE-26323

design doc
https://docs.google.com/document/d/1Il_PB1SenXGr1-mmCIWEogxEMeGZe2fpuN3bMbjqiGI/edit

the initial implementation
#3920

If you are interested, please take a look in your free time. Looking forward your advice and feedback.

Thanks.

@Apache9

Copy link
Copy Markdown
Contributor

Email sent, could you please check whether you can see the email?

Thanks.

@frostruan

Copy link
Copy Markdown
ContributorAuthor

yes, I can. Thanks so much.

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.

3 participants

@frostruan@Apache-HBase@Apache9