[accumulo] branch elasticity updated (b1aa1f58ba -> f106b8c212)

2023-08-11 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

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


from b1aa1f58ba Remove getTabletHostingGoal method from TableOperations 
(#3681)
 add 293e304945 Validate that classloader context is valid when property is 
set (#3678)
 add b6add6cac3 Prevent setting deprecated properties in the shell unless 
forced (#3680)
 add 333e94604d Revert "Validate that classloader context is valid when 
property is set (#3678)"
 add adcb2d8ac7 Validate that classloader context when property is set 
(#3683)
 add 92af41860e run minor compaction earlier in tablet close (#3685)
 add e3e4c26e65 Attempt to prevent half-closed Tablet due to failing minc 
(#3677)
 add fca29a9f85 Merge branch '2.1'
 new f106b8c212 Merge branch 'main' into elasticity

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../accumulo/core/classloader/ClassLoaderUtil.java |  19 ++
 .../core/conf/ConfigurationTypeHelper.java |   2 +-
 .../core/spi/common/ContextClassLoaderFactory.java |   4 +-
 .../accumulo/server/conf/TableConfiguration.java   |   8 +
 .../org/apache/accumulo/server/util/PropUtil.java  |  15 +-
 .../accumulo/server/util/SystemPropUtil.java   |  19 +-
 .../tserver/tablet/MinorCompactionTask.java|   9 +-
 .../org/apache/accumulo/tserver/tablet/Tablet.java |  75 --
 .../accumulo/shell/commands/ConfigCommand.java |  31 ++-
 .../test/functional/HalfClosedTablet2IT.java   | 121 +
 .../test/functional/HalfClosedTabletIT.java| 282 +
 .../org/apache/accumulo/test/shell/ShellIT.java|  16 +-
 .../apache/accumulo/test/shell/ShellServerIT.java  |  79 ++
 13 files changed, 638 insertions(+), 42 deletions(-)
 create mode 100644 
test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTablet2IT.java
 create mode 100644 
test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTabletIT.java



[accumulo] 01/01: Merge branch 'main' into elasticity

2023-08-11 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

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

commit f106b8c2122b54d8598fc5595b3132485a4239ba
Merge: b1aa1f58ba fca29a9f85
Author: Keith Turner 
AuthorDate: Fri Aug 11 18:02:42 2023 -0400

Merge branch 'main' into elasticity

 .../accumulo/core/classloader/ClassLoaderUtil.java |  19 ++
 .../core/conf/ConfigurationTypeHelper.java |   2 +-
 .../core/spi/common/ContextClassLoaderFactory.java |   4 +-
 .../accumulo/server/conf/TableConfiguration.java   |   8 +
 .../org/apache/accumulo/server/util/PropUtil.java  |  15 +-
 .../accumulo/server/util/SystemPropUtil.java   |  19 +-
 .../tserver/tablet/MinorCompactionTask.java|   9 +-
 .../org/apache/accumulo/tserver/tablet/Tablet.java |  75 --
 .../accumulo/shell/commands/ConfigCommand.java |  31 ++-
 .../test/functional/HalfClosedTablet2IT.java   | 121 +
 .../test/functional/HalfClosedTabletIT.java| 282 +
 .../org/apache/accumulo/test/shell/ShellIT.java|  16 +-
 .../apache/accumulo/test/shell/ShellServerIT.java  |  79 ++
 13 files changed, 638 insertions(+), 42 deletions(-)

diff --cc 
test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTablet2IT.java
index 00,187feff222..fa037d35ca
mode 00,100644..100644
--- 
a/test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTablet2IT.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTablet2IT.java
@@@ -1,0 -1,121 +1,121 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one
+  * or more contributor license agreements.  See the NOTICE file
+  * distributed with this work for additional information
+  * regarding copyright ownership.  The ASF licenses this file
+  * to you under the Apache License, Version 2.0 (the
+  * "License"); you may not use this file except in compliance
+  * with the License.  You may obtain a copy of the License at
+  *
+  *   https://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing,
+  * software distributed under the License is distributed on an
+  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  * KIND, either express or implied.  See the License for the
+  * specific language governing permissions and limitations
+  * under the License.
+  */
+ package org.apache.accumulo.test.functional;
+ 
+ import java.io.File;
+ 
+ import org.apache.accumulo.core.client.Accumulo;
+ import org.apache.accumulo.core.conf.Property;
+ import org.apache.accumulo.core.data.Mutation;
+ import org.apache.accumulo.core.data.TableId;
+ import org.apache.accumulo.core.data.Value;
+ import org.apache.accumulo.core.spi.fs.DelegatingChooser;
+ import org.apache.accumulo.core.spi.fs.PreferredVolumeChooser;
+ import org.apache.accumulo.harness.MiniClusterConfigurationCallback;
+ import org.apache.accumulo.harness.SharedMiniClusterBase;
+ import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
+ import org.apache.accumulo.test.util.Wait;
+ import org.apache.hadoop.conf.Configuration;
+ import org.apache.hadoop.io.Text;
+ import org.junit.jupiter.api.AfterAll;
+ import org.junit.jupiter.api.BeforeAll;
+ import org.junit.jupiter.api.Test;
+ 
+ // This covers issues like that reported in 
https://github.com/apache/accumulo/issues/3674
+ // where a failing minor compaction leaves the Tablet in a half-closed state 
that prevents it
+ // from unloading and the TServer from shutting down normally.
+ // This test recreates that scenario by setting an invalid context and 
verifies that the
+ // tablet can recover and unload after the context is set correctly.
+ public class HalfClosedTablet2IT extends SharedMiniClusterBase {
+ 
+   public static class HalfClosedTablet2ITConfiguration implements 
MiniClusterConfigurationCallback {
+ 
+ @Override
+ public void configureMiniCluster(MiniAccumuloConfigImpl cfg, 
Configuration coreSite) {
 -  cfg.setNumTservers(1);
++  cfg.getClusterServerConfiguration().setNumDefaultTabletServers(1);
+   cfg.setProperty(Property.GENERAL_VOLUME_CHOOSER, 
DelegatingChooser.class.getName());
+   cfg.setProperty("general.custom.volume.chooser.default",
+   PreferredVolumeChooser.class.getName());
+   cfg.setProperty("general.custom.volume.preferred.default",
+   new File(cfg.getDir().getAbsolutePath(), 
"/accumulo").toURI().toString());
+ }
+   }
+ 
+   @BeforeAll
+   public static void startup() throws Exception {
+ SharedMiniClusterBase.startMiniClusterWithConfig(new 
HalfClosedTablet2ITConfiguration());
+   }
+ 
+   @AfterAll
+   public static void shutdown() throws Exception {
+ SharedMiniClusterBase.stopMiniCluster();
+   }
+ 
+   @Test
+   public void testInvalidContextCausesVolumeChooserFailure() throws Exception 
{
+ 
+ // In this scenario an invalid context causes the 

[accumulo] 01/01: Merge branch '2.1'

2023-08-11 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

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

commit fca29a9f85bd06f0a81d637a92bb5f4700a26894
Merge: 38d28c233c e3e4c26e65
Author: Keith Turner 
AuthorDate: Fri Aug 11 17:47:23 2023 -0400

Merge branch '2.1'

 .../accumulo/core/classloader/ClassLoaderUtil.java |  19 ++
 .../core/conf/ConfigurationTypeHelper.java |   2 +-
 .../core/spi/common/ContextClassLoaderFactory.java |   4 +-
 .../accumulo/server/conf/TableConfiguration.java   |   8 +
 .../org/apache/accumulo/server/util/PropUtil.java  |  15 +-
 .../accumulo/server/util/SystemPropUtil.java   |  19 +-
 .../accumulo/tserver/TabletClientHandler.java  |   3 +
 .../accumulo/tserver/tablet/CompactableImpl.java   |   7 +
 .../tserver/tablet/MinorCompactionTask.java|   9 +-
 .../org/apache/accumulo/tserver/tablet/Tablet.java |  78 --
 .../accumulo/shell/commands/ConfigCommand.java |  31 ++-
 .../test/functional/HalfClosedTablet2IT.java   | 121 +
 .../test/functional/HalfClosedTabletIT.java| 282 +
 .../org/apache/accumulo/test/shell/ShellIT.java|  16 +-
 .../apache/accumulo/test/shell/ShellServerIT.java  |  79 ++
 15 files changed, 651 insertions(+), 42 deletions(-)

diff --cc 
core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java
index 9daadb58b4,8893ae8ce9..ef5e0b3b5e
--- 
a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java
@@@ -172,8 -173,8 +172,8 @@@ public class ConfigurationTypeHelper 
  
  try {
instance = getClassInstance(context, clazzName, base);
 -} catch (RuntimeException | IOException | ReflectiveOperationException e) 
{
 +} catch (RuntimeException | ReflectiveOperationException e) {
-   log.warn("Failed to load class {} in classloader context {}", 
clazzName, context, e);
+   log.error("Failed to load class {} in classloader context {}", 
clazzName, context, e);
  }
  
  if (instance == null && defaultInstance != null) {
diff --cc 
core/src/main/java/org/apache/accumulo/core/spi/common/ContextClassLoaderFactory.java
index a742ad0a33,3d9c18683f..c0e1863802
--- 
a/core/src/main/java/org/apache/accumulo/core/spi/common/ContextClassLoaderFactory.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/spi/common/ContextClassLoaderFactory.java
@@@ -55,15 -55,16 +55,17 @@@ public interface ContextClassLoaderFact
default void init(ContextClassLoaderEnvironment env) {}
  
/**
 -   * Get the class loader for the given contextName. Callers should not cache 
the ClassLoader result
 -   * as it may change if/when the ClassLoader reloads. Implementations should 
throw a
 -   * RuntimeException of some type (such as IllegalArgumentException) if the 
provided contextName is
 -   * not supported or fails to be constructed.
 +   * Get the class loader for the given context. Callers should not cache the 
ClassLoader result as
 +   * it may change if/when the ClassLoader reloads. Implementations should 
throw a RuntimeException
 +   * of some type (such as IllegalArgumentException) if the provided context 
is not supported or
 +   * fails to be constructed.
 *
 -   * @param contextName the name of the context that represents a class 
loader that is managed by
 -   *this factory. Currently, Accumulo will only call this method for 
non-null and non-empty
 +   * @param context the name of the context that represents a class loader 
that is managed by this
-*factory (can be null)
++   *factory. Currently, Accumulo will only call this method for 
non-null and non-empty
+*context. For empty or null context, Accumulo will use the system 
classloader without
+*consulting this plugin.
 -   * @return the class loader for the given contextName
 +   * @return the class loader for the given context
 */
 -  ClassLoader getClassLoader(String contextName);
 +  ClassLoader getClassLoader(String context);
 +
  }
diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
index 349e36d43a,f190d79460..ec5db3b815
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
@@@ -18,10 -18,7 +18,8 @@@
   */
  package org.apache.accumulo.tserver.tablet;
  
- import java.io.IOException;
- 
 -import org.apache.accumulo.core.metadata.TabletFile;
 +import org.apache.accumulo.core.file.FilePrefix;
 +import org.apache.accumulo.core.metadata.ReferencedTabletFile;
  import org.apache.accumulo.core.metadata.schema.DataFileValue;
  import org.apache.accumulo.core.trace.TraceUtil;
  import org.apache.accumulo.tserver.MinorCompactionReason;
diff --cc 

[accumulo] branch main updated (38d28c233c -> fca29a9f85)

2023-08-11 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

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


from 38d28c233c Merge branch '2.1'
 add 293e304945 Validate that classloader context is valid when property is 
set (#3678)
 add b6add6cac3 Prevent setting deprecated properties in the shell unless 
forced (#3680)
 add 333e94604d Revert "Validate that classloader context is valid when 
property is set (#3678)"
 add adcb2d8ac7 Validate that classloader context when property is set 
(#3683)
 add 92af41860e run minor compaction earlier in tablet close (#3685)
 add e3e4c26e65 Attempt to prevent half-closed Tablet due to failing minc 
(#3677)
 new fca29a9f85 Merge branch '2.1'

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../accumulo/core/classloader/ClassLoaderUtil.java |  19 ++
 .../core/conf/ConfigurationTypeHelper.java |   2 +-
 .../core/spi/common/ContextClassLoaderFactory.java |   4 +-
 .../accumulo/server/conf/TableConfiguration.java   |   8 +
 .../org/apache/accumulo/server/util/PropUtil.java  |  15 +-
 .../accumulo/server/util/SystemPropUtil.java   |  19 +-
 .../accumulo/tserver/TabletClientHandler.java  |   3 +
 .../accumulo/tserver/tablet/CompactableImpl.java   |   7 +
 .../tserver/tablet/MinorCompactionTask.java|   9 +-
 .../org/apache/accumulo/tserver/tablet/Tablet.java |  78 --
 .../accumulo/shell/commands/ConfigCommand.java |  31 ++-
 .../test/functional/HalfClosedTablet2IT.java   | 121 +
 .../test/functional/HalfClosedTabletIT.java| 282 +
 .../org/apache/accumulo/test/shell/ShellIT.java|  16 +-
 .../apache/accumulo/test/shell/ShellServerIT.java  |  79 ++
 15 files changed, 651 insertions(+), 42 deletions(-)
 create mode 100644 
test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTablet2IT.java
 create mode 100644 
test/src/main/java/org/apache/accumulo/test/functional/HalfClosedTabletIT.java



[accumulo] branch 2.1 updated: Attempt to prevent half-closed Tablet due to failing minc (#3677)

2023-08-11 Thread dlmarion
This is an automated email from the ASF dual-hosted git repository.

dlmarion 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 e3e4c26e65 Attempt to prevent half-closed Tablet due to failing minc 
(#3677)
e3e4c26e65 is described below

commit e3e4c26e653eaa4e324f603db07f2e00ba50bf75
Author: Dave Marion 
AuthorDate: Fri Aug 11 17:20:27 2023 -0400

Attempt to prevent half-closed Tablet due to failing minc (#3677)

This change adds some logic to prevent NPE's, add some minor logging
changes, and catches Exception instead of IOException in 
MinorCompactionTask.
The uncaught exceptions in MinorCompactionTask were causing the minor
compaction thread to die preventing future minor compactions from starting.
This commit also adds 4 tests for different failure scenarios that were seen
when configuring an invalid context or a bad iterator.

Fixes #3674


Co-authored-by: Ed Coleman 
Co-authored-by: dtspence 
Co-authored-by: Christopher Tubbs 
Co-authored-by: Keith Turner 
---
 .../core/conf/ConfigurationTypeHelper.java |   2 +-
 .../accumulo/server/conf/TableConfiguration.java   |   8 +
 .../accumulo/tserver/TabletClientHandler.java  |   3 +
 .../accumulo/tserver/tablet/CompactableImpl.java   |   7 +
 .../tserver/tablet/MinorCompactionTask.java|   9 +-
 .../org/apache/accumulo/tserver/tablet/Tablet.java |   3 +
 .../test/functional/HalfClosedTablet2IT.java   | 121 +
 .../test/functional/HalfClosedTabletIT.java| 282 +
 8 files changed, 430 insertions(+), 5 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java 
b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java
index 8600cccaa9..8893ae8ce9 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationTypeHelper.java
@@ -174,7 +174,7 @@ public class ConfigurationTypeHelper {
 try {
   instance = getClassInstance(context, clazzName, base);
 } catch (RuntimeException | IOException | ReflectiveOperationException e) {
-  log.warn("Failed to load class {} in classloader context {}", clazzName, 
context, e);
+  log.error("Failed to load class {} in classloader context {}", 
clazzName, context, e);
 }
 
 if (instance == null && defaultInstance != null) {
diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
 
b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
index b793719cb2..138bcf2ce7 100644
--- 
a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
+++ 
b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
@@ -178,6 +178,14 @@ public class TableConfiguration extends 
ZooBasedConfiguration {
 CompactionDispatcher newDispatcher = 
Property.createTableInstanceFromPropertyName(conf,
 Property.TABLE_COMPACTION_DISPATCHER, CompactionDispatcher.class, 
null);
 
+if (newDispatcher == null) {
+  // return early to prevent NPE
+  log.error(
+  "Null returned for compaction dispatcher for table: {}. Did not 
return default value, check server log.",
+  tableId);
+  return null;
+}
+
 Map opts =
 
conf.getAllPropertiesWithPrefixStripped(Property.TABLE_COMPACTION_DISPATCHER_OPTS);
 
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
index c557905f7b..92c06c85e1 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
@@ -1009,6 +1009,9 @@ public class TabletClientHandler implements 
TabletClientService.Iface {
   } catch (IOException e) {
 log.warn("Failed to split " + keyExtent, e);
 throw new RuntimeException(e);
+  } catch (RuntimeException re) {
+log.warn("Failed to split " + keyExtent, re);
+throw re;
   }
 }
   }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
index f020657bed..852ba4d638 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
@@ -1473,6 +1473,13 @@ public class CompactableImpl implements Compactable {
 try {
   var dispatcher = 
tablet.getTableConfiguration().getCompactionDispatcher();
 
+  if (dispatcher == null) {
+log.error(
+  

[accumulo] branch 2.1 updated: run minor compaction earlier in tablet close (#3685)

2023-08-11 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

kturner 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 92af41860e run minor compaction earlier in tablet close (#3685)
92af41860e is described below

commit 92af41860e29f448f9262b9d4d16406cafa31045
Author: Keith Turner 
AuthorDate: Fri Aug 11 14:13:05 2023 -0400

run minor compaction earlier in tablet close (#3685)

Closing a tablet does two minor compactions.  This commit moves the
first minor compaction to run earlier.  The goal of this change is to
avoid leaving tablets in a half closed state when minor compaction are
failing.
---
 .../org/apache/accumulo/tserver/tablet/Tablet.java | 75 --
 1 file changed, 55 insertions(+), 20 deletions(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index cfc36719e2..d0d71bf722 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -902,7 +902,62 @@ public class Tablet extends TabletBase {
 log.trace("initiateClose(saveState={}) {}", saveState, getExtent());
 
 MinorCompactionTask mct = null;
+if (saveState) {
+  try {
+synchronized (this) {
+  // Wait for any running minor compaction before trying to start 
another. This is done for
+  // the case where the current in memory map has a lot of data. So 
wait for the running
+  // minor compaction and then start compacting the current in memory 
map before closing.
+  getTabletMemory().waitForMinC();
+}
+mct = createMinorCompactionTask(getFlushID(), 
MinorCompactionReason.CLOSE);
+  } catch (NoNodeException e) {
+throw new IllegalStateException("Exception on " + extent + " during 
prep for MinC", e);
+  }
+}
+
+if (mct != null) {
+  // Do an initial minor compaction that flushes any data in memory before 
marking that tablet
+  // as closed. Another minor compaction will be done once the tablet is 
marked as closed. There
+  // are two goals for this initial minor compaction.
+  //
+  // 1. Make the 2nd minor compaction that occurs after closing faster 
because it has less
+  // data. That is important because after the tablet is closed it can not 
be read or written
+  // to, so hopefully the 2nd compaction has little if any data because of 
this minor compaction
+  // that occurred before close.
+  //
+  // 2. Its possible a minor compaction may hang because of bad config or 
DFS problems. Taking
+  // this action before close can be less disruptive if it does hang. Also 
in the case where
+  // there is a bug that causes minor compaction to fail it will leave the 
tablet in a bad
+  // state. If that happens here before starting to close then it could 
leave the tablet in a
+  // more usable state than a failure that happens after the tablet starts 
to close.
+  //
+  // If 'mct' was null it means either a minor compaction was running, 
there was no data to
+  // minor compact, or the flush id was updating. In the case of flush id 
was updating, ideally
+  // this code would wait for flush id updates and then minor compact if 
needed, but that can
+  // not be done without setting the close state to closing to prevent 
flush id updates from
+  // starting. So if there is a flush id update going on it could cause no 
minor compaction
+  // here. There will still be a minor compaction after close.
+  //
+  // Its important to run the following minor compaction outside of any 
sync blocks as this
+  // could needlessly block scans. The resources needed for the minor 
compaction have already
+  // been reserved in a sync block.
+  mct.run();
+}
+
 synchronized (this) {
+
+  if (saveState) {
+// Wait for any running minc to finish before we start shutting things 
down in the tablet.
+// It is possible that this function was unable to initiate a minor 
compaction above and
+// something else did because of race conditions (because everything 
above happens before
+// marking anything closed so normal actions could still start minor 
compactions). If
+// something did start lets wait on it before marking things closed.
+getTabletMemory().waitForMinC();
+  }
+
+  // This check is intentionally done later in the method because the 
check and change of the
+  // closeState variable need to be atomic, so both are done in the same 
sync block.
   if (isClosed() || isClosing()) {
 String msg = "Tablet " + getExtent() + " already " + closeState;
 throw new 

[accumulo] branch 2.1 updated (b6add6cac3 -> adcb2d8ac7)

2023-08-11 Thread kturner
This is an automated email from the ASF dual-hosted git repository.

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


from b6add6cac3 Prevent setting deprecated properties in the shell unless 
forced (#3680)
 add 333e94604d Revert "Validate that classloader context is valid when 
property is set (#3678)"
 add adcb2d8ac7 Validate that classloader context when property is set 
(#3683)

No new revisions were added by this update.

Summary of changes:
 .../accumulo/core/classloader/ClassLoaderUtil.java | 29 --
 .../DefaultContextClassLoaderFactory.java  | 20 --
 .../core/spi/common/ContextClassLoaderFactory.java | 30 ++-
 .../core/classloader/URLClassLoaderFactory.java| 44 +-
 .../start/classloader/vfs/ContextManager.java  | 10 +
 5 files changed, 31 insertions(+), 102 deletions(-)



[accumulo] branch elasticity updated: Remove getTabletHostingGoal method from TableOperations (#3681)

2023-08-11 Thread jmark99
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/elasticity by this push:
 new b1aa1f58ba Remove getTabletHostingGoal method from TableOperations 
(#3681)
b1aa1f58ba is described below

commit b1aa1f58ba40403ce516f50eadcbe94f16d25306
Author: Mark Owens 
AuthorDate: Fri Aug 11 10:18:06 2023 -0400

Remove getTabletHostingGoal method from TableOperations (#3681)

Remove the `getTabletHostingGoal` method from `TableOperations` as the 
information can now be retrieved with the more robust `getTabletInformation` 
method.

The shell command, `getgoals`, still works as before, but the 
`GetTabletHostingGoalCommand` was updated to use the new
`getTabletInformation` method to retrieve the necessary information rather 
than the removed `getTabletHostingGoal` method.
---
 .../core/client/admin/TableOperations.java | 16 ++
 .../core/clientImpl/TableOperationsImpl.java   | 25 --
 .../commands/GetTabletHostingGoalCommand.java  | 11 +++---
 3 files changed, 5 insertions(+), 47 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java 
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index b30aace300..a5fd10a9df 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -1023,20 +1023,8 @@ public interface TableOperations {
   }
 
   /**
-   * Retrieve the hosting goal for a range of tablets in the specified table.
-   *
-   * @param tableName table name
-   * @param range tablet range
-   * @since 4.0.0
-   */
-  default Stream getTabletHostingGoal(final String 
tableName,
-  final Range range) throws TableNotFoundException {
-throw new UnsupportedOperationException();
-  }
-
-  /**
-   * @return a stream of tablets information for tablets that fall in the 
specified range. The
-   * stream may be backed by a scanner, so its best to close the 
stream.
+   * @return a stream of tablet information for tablets that fall in the 
specified range. The stream
+   * may be backed by a scanner, so it's best to close the stream.
* @since 4.0.0
*/
   default Stream getTabletInformation(final String 
tableName, final Range range)
diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
index 2fa8433d1f..6c88dba09e 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
@@ -94,7 +94,6 @@ import 
org.apache.accumulo.core.client.admin.CloneConfiguration;
 import org.apache.accumulo.core.client.admin.CompactionConfig;
 import org.apache.accumulo.core.client.admin.DiskUsage;
 import org.apache.accumulo.core.client.admin.FindMax;
-import org.apache.accumulo.core.client.admin.HostingGoalForTablet;
 import org.apache.accumulo.core.client.admin.ImportConfiguration;
 import org.apache.accumulo.core.client.admin.Locations;
 import org.apache.accumulo.core.client.admin.NewTableConfiguration;
@@ -2157,30 +2156,6 @@ public class TableOperationsImpl extends 
TableOperationsHelper {
 }
   }
 
-  @Override
-  public Stream getTabletHostingGoal(final String 
tableName,
-  final Range range) throws TableNotFoundException {
-EXISTING_TABLE_NAME.validate(tableName);
-
-final Text scanRangeStart = (range.getStartKey() == null) ? null : 
range.getStartKey().getRow();
-TableId tableId = context.getTableId(tableName);
-
-TabletsMetadata tabletsMetadata =
-
context.getAmple().readTablets().forTable(tableId).overlapping(scanRangeStart, 
true, null)
-.fetch(HOSTING_GOAL, PREV_ROW).checkConsistency().build();
-
-return tabletsMetadata.stream().peek(tm -> {
-  if (scanRangeStart != null && tm.getEndRow() != null
-  && tm.getEndRow().compareTo(scanRangeStart) < 0) {
-log.debug("tablet {} is before scan start range: {}", tm.getExtent(), 
scanRangeStart);
-throw new RuntimeException("Bug in ample or this code.");
-  }
-}).takeWhile(tm -> tm.getPrevEndRow() == null
-|| !range.afterEndKey(new 
Key(tm.getPrevEndRow()).followingKey(PartialKey.ROW)))
-.map(tm -> new HostingGoalForTablet(new TabletIdImpl(tm.getExtent()), 
tm.getHostingGoal()))
-.onClose(tabletsMetadata::close);
-  }
-
   @Override
   public Stream getTabletInformation(final String 
tableName, final Range range)
   throws TableNotFoundException {
diff --git 
a/shell/src/main/java/org/apache/accumulo/shell/commands/GetTabletHostingGoalCommand.java