Skip to content

HBASE-27903 Skip submitting Split/Merge procedure when split/merge is… - #6169

Merged
NihalJain merged 1 commit into
apache:masterfrom
NihalJain:HBASE-27903
Aug 30, 2024
Merged

HBASE-27903 Skip submitting Split/Merge procedure when split/merge is…#6169
NihalJain merged 1 commit into
apache:masterfrom
NihalJain:HBASE-27903

Conversation

@NihalJain

Copy link
Copy Markdown
Contributor

… disabled at table level

  • Fail fast by adding a check before even submitting a procedure
  • Update test cases to assert for expected exception post this change
  • Remove deprecated method mergeRegionsAsync's usage in test
  • Make use of RegionInfo.getShortNameToLog instead of logging complete region info
  • Update comments in procedure implementation

… disabled at table level
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
@NihalJain

Copy link
Copy Markdown
ContributorAuthor

Verified the change in standalone mode. The code works as expected i.e. the procedure is not even submitted and we fail fast with this patch and as a result no procedure rollback happens.

Shell output with fix:

hbase:004:0> merge_region '299fda3a5e8630098a46363b0581fb9a', 'e0c5f133ae0f23ce56296b8c763fa00f'
ERROR: org.apache.hadoop.hbase.DoNotRetryIOException: Merge of [299fda3a5e8630098a46363b0581fb9a, e0c5f133ae0f23ce56296b8c763fa00f] failed as region merge is disabled for the table
at org.apache.hadoop.hbase.master.HMaster.mergeRegions(HMaster.java:2269)
at org.apache.hadoop.hbase.master.MasterRpcServices.mergeTableRegions(MasterRpcServices.java:942)
at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:444)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124)
at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:102)
at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:82)
For usage try 'help "merge_region"'
Took 0.2516 seconds
hbase:006:0> split 'testcreatetablewithsplitdisableparameter','30'
ERROR: org.apache.hadoop.hbase.DoNotRetryIOException: Split region testcreatetablewithsplitdisableparameter,,1724177100721.42bc211e7063bb1d8fa7619a50a98c3a. failed as region split is disabled for the table
at org.apache.hadoop.hbase.master.HMaster.splitRegion(HMaster.java:2303)
at org.apache.hadoop.hbase.master.MasterRpcServices.splitRegion(MasterRpcServices.java:954)
at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:444)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124)
at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:102)
at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:82)
For usage try 'help "split"'
Took 0.0204 seconds

Shell output without fix:

hbase:010:0> merge_region '62b765354fdb007d571b98b5e6b5542e.', '212a918d92b35bf3afe270962bedb350'
ERROR: Merge of [{ENCODED => 62b765354fdb007d571b98b5e6b5542e, NAME => 'testCreateTableWithMergeDisableParameter,,1724176086193.62b765354fdb007d571b98b5e6b5542e.', STARTKEY => '', ENDKEY => 'a'}, {ENCODED => 212a918d92b35bf3afe270962bedb350, NAME => 'testCreateTableWithMergeDisableParameter,a,1724176086193.212a918d92b35bf3afe270962bedb350.', STARTKEY => 'a', ENDKEY => ''}] failed as region merge is disabled for the table
For usage try 'help "merge_region"'
Took 0.2405 seconds
hbase:007:0> split 'testcreatetablewithsplitdisableparameter','30'
ERROR: Split region testcreatetablewithsplitdisableparameter,,1724176000059.66d8a2862968698d012927d9f9d4dbcc. failed as region split is disabled for the table
For usage try 'help "split"'
Took 0.3706 seconds

Logs with fix:

2024-08-20T23:34:41,735 WARN [RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=16000] master.HMaster: Merge is disabled for the table! Skipping merge of [299fda3a5e8630098a46363b0581fb9a, e0c5f133ae0f23ce56296b8c763fa00f]
2024-08-20T23:35:07,354 WARN [RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=16000] master.HMaster: Split is disabled for the table! Skipping split of {ENCODED => 42bc211e7063bb1d8fa7619a50a98c3a, NAME => 'testcreatetablewithsplitdisableparameter,,1724177100721.42bc211e7063bb1d8fa7619a50a98c3a.', STARTKEY => '', ENDKEY => ''}

Logs without fix:

2024-08-20T23:18:53,744 WARN [PEWorker-2] assignment.MergeTableRegionsProcedure: Merge is disabled for the table! Skipping merge of [{ENCODED => 62b765354fdb007d571b98b5e6b5542e, NAME => 'testCreateTableWithMergeDisableParameter,,1724176086193.62b765354fdb007d571b98b5e6b5542e.', STARTKEY => '', ENDKEY => 'a'}, {ENCODED => 212a918d92b35bf3afe270962bedb350, NAME => 'testCreateTableWithMergeDisableParameter,a,1724176086193.212a918d92b35bf3afe270962bedb350.', STARTKEY => 'a', ENDKEY => ''}]
2024-08-20T23:17:36,504 WARN [PEWorker-1] assignment.SplitTableRegionProcedure: pid=13, split is disabled for the table! Skipping split of {ENCODED => 66d8a2862968698d012927d9f9d4dbcc, NAME => 'testcreatetablewithsplitdisableparameter,,1724176000059.66d8a2862968698d012927d9f9d4dbcc.', STARTKEY => '', ENDKEY => ''}

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 26sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ master Compile Tests _
+1 💚mvninstall3m 4smaster passed
+1 💚compile3m 1smaster passed
+1 💚checkstyle0m 35smaster passed
+1 💚spotbugs1m 33smaster passed
+1 💚spotless0m 46sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall2m 52sthe patch passed
+1 💚compile3m 0sthe patch passed
+1 💚javac3m 0sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 35sthe patch passed
+1 💚spotbugs1m 38sthe patch passed
+1 💚hadoopcheck11m 1sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 41spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 10sThe patch does not generate ASF License warnings.
36m 13s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6169/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6169
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux cd520052c879 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a4ae7e7
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count85 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6169/1/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 34sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall3m 5smaster passed
+1 💚compile1m 0smaster passed
+1 💚javadoc0m 31smaster passed
+1 💚shadedjars5m 26sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 0sthe patch passed
+1 💚compile0m 59sthe patch passed
+1 💚javac0m 59sthe patch passed
+1 💚javadoc0m 29sthe patch passed
+1 💚shadedjars5m 24spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit228m 26shbase-server in the patch passed.
253m 21s
SubsystemReport/Notes
DockerClientAPI=1.46 ServerAPI=1.46 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6169/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6169
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 691532b33634 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a4ae7e7
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6169/1/testReport/
Max. process+thread count5026 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6169/1/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.


// check and ensure that region do not get merged
Future<?> f = admin.mergeRegionsAsync(nameOfRegionA, nameOfRegionB, true);
Future<?> f = admin.mergeRegionsAsync(new byte[][] { nameOfRegionA, nameOfRegionB }, true);

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 change? Because the method which takes two byte[] is deprecated?

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.

Hi Duo, yes saw this deprecated usage in the test. mentioned same in description. let me know if should revert

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.

No problem. Just want to confirm.

@NihalJain
NihalJain merged commit 2ac657c into apache:masterAug 30, 2024
NihalJain added a commit to NihalJain/hbase that referenced this pull request Aug 30, 2024
… disabled at table level (apache#6169)
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Remove deprecated method mergeRegionsAsync's usage in test
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 2ac657c)
NihalJain added a commit to NihalJain/hbase that referenced this pull request Aug 30, 2024
… disabled at table level (apache#6169)
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Remove deprecated method mergeRegionsAsync's usage in test
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 2ac657c)
NihalJain added a commit that referenced this pull request Sep 4, 2024
… disabled at table level (#6169) (#6185)
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Remove deprecated method mergeRegionsAsync's usage in test
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 2ac657c)
NihalJain added a commit that referenced this pull request Sep 23, 2024
… disabled at table level (#6186) (#6169)
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Remove deprecated method mergeRegionsAsync's usage in test
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
- Fix tests as per 2.x code base: here the HBTU creates an instance of HBaseAdmin whose methods splitRegionAsync/mergeRegionsAsync seem to propagate error immediately without a call to future.get() which is in contrast to how it default admin instance of HBTU works in 3.x.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 2ac657c)
NihalJain added a commit to NihalJain/hbase that referenced this pull request Sep 23, 2024
… disabled at table level (apache#6186) (apache#6169)
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Remove deprecated method mergeRegionsAsync's usage in test
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
- Fix tests as per 2.x code base: here the HBTU creates an instance of HBaseAdmin whose methods splitRegionAsync/mergeRegionsAsync seem to propagate error immediately without a call to future.get() which is in contrast to how it default admin instance of HBTU works in 3.x.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit e658496)
NihalJain added a commit that referenced this pull request Sep 25, 2024
… disabled at table level (#6186) (#6169) (#6285)
- Fail fast by adding a check before even submitting a procedure
- Update test cases to assert for expected exception post this change
- Remove deprecated method mergeRegionsAsync's usage in test
- Make use of RegionInfo.getShortNameToLog instead of logging complete region info
- Update comments in procedure implementation
- Fix tests as per 2.x code base: here the HBTU creates an instance of HBaseAdmin whose methods splitRegionAsync/mergeRegionsAsync seem to propagate error immediately without a call to future.get() which is in contrast to how it default admin instance of HBTU works in 3.x.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit e658496)
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

@NihalJain@Apache-HBase@Apache9