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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/graceful_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

log "Previous balancer state was $HBASE_BALANCER_STATE"
fi

Expand Down
4 changes: 3 additions & 1 deletion hbase-shell/src/main/ruby/jar-bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ def debug?

IRB.conf[:IRB_NAME] = 'hbase'
IRB.conf[:AP_NAME] = 'hbase'
IRB.conf[:PROMPT_MODE] = :CUSTOM
if interactive
IRB.conf[:PROMPT_MODE] = :CUSTOM
end
IRB.conf[:BACK_TRACE_LIMIT] = 0 unless full_backtrace

# Create a workspace we'll use across sessions.
Expand Down