This is an automated email from the ASF dual-hosted git repository.

ddanielr pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new 4e0c998dc5 Stop GC and SServers first when stopping cluster (#5396)
4e0c998dc5 is described below

commit 4e0c998dc56d2acced4c69e4ec37e561b830f42e
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Tue Mar 11 20:41:59 2025 -0400

    Stop GC and SServers first when stopping cluster (#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
---
 assemble/bin/accumulo-cluster | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/assemble/bin/accumulo-cluster b/assemble/bin/accumulo-cluster
index 489bdd279b..1393bd5a17 100755
--- a/assemble/bin/accumulo-cluster
+++ b/assemble/bin/accumulo-cluster
@@ -482,9 +482,29 @@ function control_services() {
   local group
   local tserver
   local G
+  local sserver
+  local gc
   if [[ $ARG_ALL == 1 && $ARG_LOCAL == 0 && $operation == "stop" ]]; then
     echo "Stopping Accumulo cluster..."
     if ! isDebug; then
+      # Stop all of the the Scan Server processes
+      for group in $SSERVER_GROUPS; do
+        echo "Executing $(green "$ARG_CMD") on $(purple scan servers) for 
group $(yellow "$group")"
+        hosts="SSERVER_HOSTS_$group"
+        for sserver in ${!hosts}; do
+          if canRunOnHost "$sserver"; then
+            execute_command "$operation" "$sserver" sserver "$group" "-g" 
"$group"
+          fi
+        done
+      done
+      # Stop the GC processes, they scan and write to the metadata table
+      for gc in $GC_HOSTS; do
+        if canRunOnHost "$gc"; then
+          echo "Executing $(green "$ARG_CMD") on $(purple garbage collectors)"
+          execute_command "$operation" "$gc" gc "default"
+        fi
+      done
+      # Try to cleanly stop the TabletServers and Manager
       if ! "$accumulo_cmd" admin stopAll; then
         echo "Invalid password or unable to connect to the manager"
         echo "Initiating forced shutdown in 15 seconds (Ctrl-C to abort)"
@@ -559,7 +579,6 @@ function control_services() {
     done
   fi
 
-  local gc
   if [[ $ARG_ALL == 1 || $ARG_GC == 1 ]]; then
     for gc in $GC_HOSTS; do
       if canRunOnHost "$gc"; then
@@ -590,7 +609,6 @@ function control_services() {
   fi
 
   local sserver_groups
-  local sserver
   if [[ $ARG_ALL == 1 || $ARG_SSERVER == 1 ]]; then
     sserver_groups=$SSERVER_GROUPS
     if [[ -n $ARG_SSERVER_GROUP ]]; then

Reply via email to