Skip to content

HBASE-27086 Fix graceful_stop cannot take previous balancer status by incompatibility of hbase shell prompt - #4490

Closed
bitterfox wants to merge 2 commits into
apache:masterfrom
bitterfox:HBASE-27086
Closed

HBASE-27086 Fix graceful_stop cannot take previous balancer status by incompatibility of hbase shell prompt#4490
bitterfox wants to merge 2 commits into
apache:masterfrom
bitterfox:HBASE-27086

Conversation

@bitterfox

@bitterfoxbitterfox commented Jun 6, 2022

Copy link
Copy Markdown
Contributor

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

There're 2 issues

  • hbase shell shows prompt always even through echo "balance_switch false" | hbase shell -n (noninteractive mode or piped)
  • irb now shows an empty line at end of the output, so tail -1 retrieve the empty line. need tail -2 | head -1 to retrieve true/false for previous balancer status

Need this patch in branch-2.4, 2.5, 2, 3, master

IRB.conf[:IRB_NAME] = 'hbase'
IRB.conf[:AP_NAME] = 'hbase'
IRB.conf[:PROMPT_MODE] = :CUSTOM
if IRB.conf[:PROMPT_MODE] != :NULL

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.

I'm not sure which is preferred. The behavior in this patch is similar to hbase 1.x hbase shell

if IRB.conf[:PROMPT_MODE] != :NULL: no prompt for pipe or non interaction

$ echo "balance_switch false" | bin/hbase shell
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/book.html#shell
Version 3.0.0-alpha-3-SNAPSHOT, ra712f9fa34ed3ace5ae6bf539c227a110b259a2c, Mon Jun 6 13:59:23 JST 2022
Took 0.0020 seconds balance_switch false
Previous balancer state : false Took 0.9183 seconds false
$ echo "balance_switch false" | bin/hbase shell -n
balance_switch false
Previous balancer state : false Took 0.9745 seconds false

if interactive: no prompt non interaction only (similar behavior as hbase 2.4.9)

$ echo "balance_switch false" | bin/hbase shell
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/book.html#shell
Version 3.0.0-alpha-3-SNAPSHOT, ra712f9fa34ed3ace5ae6bf539c227a110b259a2c, Mon Jun 6 13:59:23 JST 2022
Took 0.0023 seconds hbase:001:0> balance_switch false
Previous balancer state : false Took 1.0975 seconds => false
hbase:002:0> $ echo "balance_switch false" | bin/hbase shell -n
balance_switch false
Previous balancer state : false Took 0.9643 seconds false

Let me know which behavior is preferred

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'd say skip the prompt only in non-interactive mode. The general position since the introduction of the non-interactive flag is that it ought to be used for any scripted integration.

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.

Thank you for the suggestion. I see. I updated it to use interactive for condition. we can switch prompt by -n option in any case we want to do so.

Comment threadbin/graceful_stop.sh
else
log "Disabling load balancer"
HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -1)
HBASE_BALANCER_STATE=$(echo 'balance_switch false' | "$bin"/hbase --config "${HBASE_CONF_DIR}" shell -n | tail -2 | head -1)

@bitterfoxbitterfoxJun 6, 2022

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.

No idea, but empty line is added to the end of output of hbase shell. we need to take the 2nd line from the last

$ echo "balance_switch false" | bin/hbase shell -n | tail -1
$ echo "balance_switch false" | bin/hbase shell -n | tail -2 | head -1
false

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 55sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗shelldocs0m 1sShelldocs was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep1m 14sMaven dependency ordering for branch
+1 💚mvninstall2m 53smaster passed
+1 💚spotless0m 56sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall2m 53sthe patch passed
+1 💚rubocop0m 9sThere were no new rubocop issues.
+1 💚shellcheck0m 1sThere were no new shellcheck issues.
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚spotless0m 51spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 20sThe patch does not generate ASF License warnings.
11m 49s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4490
Optional Testsdupname asflicense spotless shellcheck shelldocs javac rubocop
unameLinux d8ba6d329f3d 5.4.0-1068-aws #72~18.04.1-Ubuntu SMP Thu Mar 3 08:49:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 12a9e6e
Default JavaAdoptOpenJDK-1.8.0_282-b08
Max. process+thread count71 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/console
versionsgit=2.17.1 maven=3.6.3 shellcheck=0.4.6 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 39sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall4m 31smaster passed
+1 💚javadoc2m 5smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall2m 28sthe patch passed
+1 💚javadoc1m 57sthe patch passed
_ Other Tests _
-1 ❌unit213m 43sroot in the patch failed.
227m 33s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4490
Optional Testsjavac javadoc unit
unameLinux 51658f48cfff 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 12a9e6e
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-root.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/testReport/
Max. process+thread count2441 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/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 42sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗shelldocs0m 0sShelldocs was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep1m 15sMaven dependency ordering for branch
+1 💚mvninstall3m 4smaster passed
+1 💚spotless0m 37sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall2m 36sthe patch passed
-0 ⚠️rubocop0m 9sThe patch generated 1 new + 8 unchanged - 0 fixed = 9 total (was 8)
+1 💚shellcheck0m 1sThere were no new shellcheck issues.
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚spotless0m 38spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
10m 35s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4490
Optional Testsdupname asflicense spotless shellcheck shelldocs javac rubocop
unameLinux 6043e5b5e80b 5.4.0-1068-aws #72~18.04.1-Ubuntu SMP Thu Mar 3 08:49:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 9342653
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count61 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/console
versionsgit=2.17.1 maven=3.6.3 shellcheck=0.4.6 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 🆗reexec1m 10sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 16smaster passed
+1 💚javadoc2m 9smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 2sthe patch passed
+1 💚javadoc2m 8sthe patch passed
_ Other Tests _
+1 💚unit251m 18sroot in the patch passed.
265m 34s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4490
Optional Testsjavac javadoc unit
unameLinux 2d5d3a07d442 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 9342653
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/testReport/
Max. process+thread count3799 (vs. ulimit of 30000)
modulesC: hbase-shell . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/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.

@junegunn

Copy link
Copy Markdown
Member

Thanks @bitterfox. This bug was later fixed by another PR: #4680

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.

4 participants

@bitterfox@Apache-HBase@junegunn@busbey