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

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

commit fd387ba605613dd2725fe0de8a4eb4ff22e881ed
Merge: bd7d82e30b bed5e3628d
Author: Daniel Roberts <ddani...@gmail.com>
AuthorDate: Mon Jan 22 15:26:40 2024 +0000

    Merge branch 'main' into elasticity

 assemble/conf/accumulo-env.sh                      |  2 +-
 assemble/src/main/resources/LICENSE                | 42 +++++++++++-----------
 pom.xml                                            | 17 ++++-----
 .../accumulo/server/tables/TableManager.java       | 22 ++++++------
 .../apache/accumulo/gc/SimpleGarbageCollector.java |  2 +-
 .../accumulo/manager/FateServiceHandler.java       | 16 ++++++---
 .../manager/tableOps/ChangeTableState.java         |  9 +++--
 .../manager/tableOps/clone/FinishCloneTable.java   |  8 +++--
 .../manager/tableOps/create/FinishCreateTable.java |  6 ++--
 .../manager/tableOps/delete/DeleteTable.java       |  6 +++-
 .../tableOps/tableImport/FinishImportTable.java    |  5 ++-
 11 files changed, 82 insertions(+), 53 deletions(-)

diff --cc 
server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java
index d8567ca2a2,9d66cdcc93..abef59d713
--- 
a/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java
+++ 
b/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java
@@@ -66,10 -62,8 +67,11 @@@ import org.apache.accumulo.core.clientI
  import org.apache.accumulo.core.conf.Property;
  import org.apache.accumulo.core.data.NamespaceId;
  import org.apache.accumulo.core.data.TableId;
 -import org.apache.accumulo.core.fate.ReadOnlyTStore.TStatus;
 +import org.apache.accumulo.core.dataImpl.KeyExtent;
 +import org.apache.accumulo.core.dataImpl.thrift.TRange;
 +import org.apache.accumulo.core.fate.FateInstanceType;
 +import org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus;
+ import org.apache.accumulo.core.manager.state.tables.TableState;
  import org.apache.accumulo.core.manager.thrift.BulkImportState;
  import org.apache.accumulo.core.manager.thrift.FateOperation;
  import org.apache.accumulo.core.manager.thrift.FateService;
@@@ -407,9 -390,12 +409,12 @@@ class FateServiceHandler implements Fat
          }
  
          goalMessage += "Online table " + tableId;
+         final EnumSet<TableState> expectedCurrStates =
+             EnumSet.of(TableState.ONLINE, TableState.OFFLINE);
 -        manager.fate().seedTransaction(op.toString(), opid,
 +        manager.fate(type).seedTransaction(op.toString(), tid,
-             new TraceRepo<>(new ChangeTableState(namespaceId, tableId, 
tableOp)), autoCleanup,
-             goalMessage);
+             new TraceRepo<>(
+                 new ChangeTableState(namespaceId, tableId, tableOp, 
expectedCurrStates)),
+             autoCleanup, goalMessage);
          break;
        }
        case TABLE_OFFLINE: {
@@@ -432,9 -418,12 +437,12 @@@
          }
  
          goalMessage += "Offline table " + tableId;
+         final EnumSet<TableState> expectedCurrStates =
+             EnumSet.of(TableState.ONLINE, TableState.OFFLINE);
 -        manager.fate().seedTransaction(op.toString(), opid,
 +        manager.fate(type).seedTransaction(op.toString(), tid,
-             new TraceRepo<>(new ChangeTableState(namespaceId, tableId, 
tableOp)), autoCleanup,
-             goalMessage);
+             new TraceRepo<>(
+                 new ChangeTableState(namespaceId, tableId, tableOp, 
expectedCurrStates)),
+             autoCleanup, goalMessage);
          break;
        }
        case TABLE_MERGE: {
diff --cc 
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/clone/FinishCloneTable.java
index 3733271049,9c2b46f2a2..b406d43243
--- 
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/clone/FinishCloneTable.java
+++ 
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/clone/FinishCloneTable.java
@@@ -47,12 -49,13 +49,14 @@@ class FinishCloneTable extends ManagerR
      // may never create files.. therefore there is no need to consume 
namenode space w/ directories
      // that are not used... tablet will create directories as needed
  
+     final EnumSet<TableState> expectedCurrStates = EnumSet.of(TableState.NEW);
      if (cloneInfo.keepOffline) {
-       environment.getTableManager().transitionTableState(cloneInfo.tableId, 
TableState.OFFLINE);
+       environment.getTableManager().transitionTableState(cloneInfo.tableId, 
TableState.OFFLINE,
+           expectedCurrStates);
      } else {
 -      environment.getTableManager().transitionTableState(cloneInfo.tableId, 
TableState.ONLINE,
 -          expectedCurrStates);
 +      // transition clone table state to state of original table
 +      TableState ts = 
environment.getTableManager().getTableState(cloneInfo.srcTableId);
-       environment.getTableManager().transitionTableState(cloneInfo.tableId, 
ts);
++      environment.getTableManager().transitionTableState(cloneInfo.tableId, 
ts, expectedCurrStates);
      }
  
      Utils.unreserveNamespace(environment, cloneInfo.srcNamespaceId, tid, 
false);
diff --cc 
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/delete/DeleteTable.java
index b511056e2a,fcd0e7984e..2e523483c1
--- 
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/delete/DeleteTable.java
+++ 
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/delete/DeleteTable.java
@@@ -47,9 -49,11 +49,11 @@@ public class DeleteTable extends Manage
  
    @Override
    public Repo<Manager> call(long tid, Manager env) {
-     env.getTableManager().transitionTableState(tableId, TableState.DELETING);
+     final EnumSet<TableState> expectedCurrStates =
+         EnumSet.of(TableState.ONLINE, TableState.OFFLINE);
+     env.getTableManager().transitionTableState(tableId, TableState.DELETING, 
expectedCurrStates);
 -    env.getEventCoordinator().event("deleting table %s ", tableId);
 -    return new CleanUp(tableId, namespaceId);
 +    env.getEventCoordinator().event(tableId, "deleting table %s ", tableId);
 +    return new ReserveTablets(tableId, namespaceId);
    }
  
    @Override

Reply via email to