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

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


The following commit(s) were added to refs/heads/main by this push:
     new 51f433be28 Modified TabletGroupWatcher to only assign/balance during 
upgrade (#5664)
51f433be28 is described below

commit 51f433be2829c0592110c1bb72866342680280e3
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Mon Jun 30 10:15:01 2025 -0400

    Modified TabletGroupWatcher to only assign/balance during upgrade (#5664)
    
    During upgrade testing a NullPointerException was seen in the
    TabletGroupWatcher when referencing Manager.getSplitter(). This
    change will prevent the TabletGroupWatcher from splitting or
    compacting tablets while the upgrade is in progress.
---
 .../apache/accumulo/manager/TabletGroupWatcher.java    | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git 
a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
 
b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
index 6e306936a6..ffe2e310ed 100644
--- 
a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
+++ 
b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
@@ -430,6 +430,19 @@ abstract class TabletGroupWatcher extends 
AccumuloDaemonThread {
       SortedMap<TServerInstance,TabletServerStatus> currentTServers, boolean 
isFullScan)
       throws TException, DistributedStoreException, WalMarkerException, 
IOException {
 
+    // When upgrading the Manager needs the TabletGroupWatcher
+    // to assign and balance the root and metadata tables, but
+    // the Manager does not fully start up until the upgrade
+    // is complete. This means that objects like the Splitter
+    // are not going to be initialized and the Coordinator
+    // is not going to be started.
+    final boolean currentlyUpgrading = manager.isUpgrading();
+    if (currentlyUpgrading) {
+      LOG.debug(
+          "Currently upgrading, splits and compactions for tables in level {} 
will occur once upgrade is completed.",
+          store.getLevel());
+    }
+
     final TableMgmtStats tableMgmtStats = new TableMgmtStats();
     final boolean shuttingDownAllTabletServers =
         
tableMgmtParams.getServersToShutdown().equals(currentTServers.keySet());
@@ -604,12 +617,13 @@ abstract class TabletGroupWatcher extends 
AccumuloDaemonThread {
       }
 
       final boolean needsSplit = 
actions.contains(ManagementAction.NEEDS_SPLITTING);
-      if (needsSplit) {
+      if (!currentlyUpgrading && needsSplit) {
         LOG.debug("{} may need splitting.", tm.getExtent());
         manager.getSplitter().initiateSplit(tm.getExtent());
       }
 
-      if (actions.contains(ManagementAction.NEEDS_COMPACTING) && 
compactionGenerator != null) {
+      if (!currentlyUpgrading && 
actions.contains(ManagementAction.NEEDS_COMPACTING)
+          && compactionGenerator != null) {
         // Check if tablet needs splitting, priority should be giving to 
splits over
         // compactions because it's best to compact after a split
         if (!needsSplit) {

Reply via email to