Skip to content
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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bitterfox
Copy link
Contributor

@bitterfox bitterfox commented Jun 6, 2022

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

@@ -203,7 +203,10 @@ def debug?

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

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
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
Contributor Author

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.

@@ -115,7 +115,7 @@ if [ "$nob" == "true" ]; then
HBASE_BALANCER_STATE=false
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)
Copy link
Contributor Author

@bitterfox bitterfox Jun 6, 2022

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

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 55s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 shelldocs 0m 1s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 1m 14s Maven dependency ordering for branch
+1 💚 mvninstall 2m 53s master passed
+1 💚 spotless 0m 56s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 2m 53s the patch passed
+1 💚 rubocop 0m 9s There were no new rubocop issues.
+1 💚 shellcheck 0m 1s There were no new shellcheck issues.
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 spotless 0m 51s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 20s The patch does not generate ASF License warnings.
11m 49s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense spotless shellcheck shelldocs javac rubocop
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 12a9e6e
Default Java AdoptOpenJDK-1.8.0_282-b08
Max. process+thread count 71 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/console
versions git=2.17.1 maven=3.6.3 shellcheck=0.4.6 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 39s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 4m 31s master passed
+1 💚 javadoc 2m 5s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 2m 28s the patch passed
+1 💚 javadoc 1m 57s the patch passed
_ Other Tests _
-1 ❌ unit 213m 43s root in the patch failed.
227m 33s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 12a9e6e
Default Java AdoptOpenJDK-11.0.10+9
unit https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-root.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/testReport/
Max. process+thread count 2441 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 42s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 1m 15s Maven dependency ordering for branch
+1 💚 mvninstall 3m 4s master passed
+1 💚 spotless 0m 37s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 9s Maven dependency ordering for patch
+1 💚 mvninstall 2m 36s the patch passed
-0 ⚠️ rubocop 0m 9s The patch generated 1 new + 8 unchanged - 0 fixed = 9 total (was 8)
+1 💚 shellcheck 0m 1s There were no new shellcheck issues.
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 spotless 0m 38s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
10m 35s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense spotless shellcheck shelldocs javac rubocop
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 9342653
Default Java AdoptOpenJDK-1.8.0_282-b08
rubocop https://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 count 61 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/console
versions git=2.17.1 maven=3.6.3 shellcheck=0.4.6 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 10s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for branch
+1 💚 mvninstall 3m 16s master passed
+1 💚 javadoc 2m 9s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 3m 2s the patch passed
+1 💚 javadoc 2m 8s the patch passed
_ Other Tests _
+1 💚 unit 251m 18s root in the patch passed.
265m 34s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 9342653
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/testReport/
Max. process+thread count 3799 (vs. ulimit of 30000)
modules C: hbase-shell . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4490/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Sign up for free to 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