Skip to content

Commit 4e0c998

Browse files
authored
Stop GC and SServers first when stopping cluster (apache#5396)
* Stop GC and SServers first when stopping cluster The GC and Scan Server processes can put a load onto the metadata table with scan and writes. This activity could hold up metadata tablet unloading. These processes aren't necessary for an orderly shutdown, so they can be shut down first. * Removed duplicate local declarations
1 parent 65b3fe8 commit 4e0c998

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

assemble/bin/accumulo-cluster

+20-2
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,29 @@ function control_services() {
482482
local group
483483
local tserver
484484
local G
485+
local sserver
486+
local gc
485487
if [[ $ARG_ALL == 1 && $ARG_LOCAL == 0 && $operation == "stop" ]]; then
486488
echo "Stopping Accumulo cluster..."
487489
if ! isDebug; then
490+
# Stop all of the the Scan Server processes
491+
for group in $SSERVER_GROUPS; do
492+
echo "Executing $(green "$ARG_CMD") on $(purple scan servers) for group $(yellow "$group")"
493+
hosts="SSERVER_HOSTS_$group"
494+
for sserver in ${!hosts}; do
495+
if canRunOnHost "$sserver"; then
496+
execute_command "$operation" "$sserver" sserver "$group" "-g" "$group"
497+
fi
498+
done
499+
done
500+
# Stop the GC processes, they scan and write to the metadata table
501+
for gc in $GC_HOSTS; do
502+
if canRunOnHost "$gc"; then
503+
echo "Executing $(green "$ARG_CMD") on $(purple garbage collectors)"
504+
execute_command "$operation" "$gc" gc "default"
505+
fi
506+
done
507+
# Try to cleanly stop the TabletServers and Manager
488508
if ! "$accumulo_cmd" admin stopAll; then
489509
echo "Invalid password or unable to connect to the manager"
490510
echo "Initiating forced shutdown in 15 seconds (Ctrl-C to abort)"
@@ -559,7 +579,6 @@ function control_services() {
559579
done
560580
fi
561581

562-
local gc
563582
if [[ $ARG_ALL == 1 || $ARG_GC == 1 ]]; then
564583
for gc in $GC_HOSTS; do
565584
if canRunOnHost "$gc"; then
@@ -590,7 +609,6 @@ function control_services() {
590609
fi
591610

592611
local sserver_groups
593-
local sserver
594612
if [[ $ARG_ALL == 1 || $ARG_SSERVER == 1 ]]; then
595613
sserver_groups=$SSERVER_GROUPS
596614
if [[ -n $ARG_SSERVER_GROUP ]]; then

0 commit comments

Comments
 (0)