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

commit 58b139e399fec55138b5817cf191342a3de6603e
Merge: b900be0aa6 23810d25e9
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Wed Jan 29 20:43:12 2025 +0000

    Merge branch '3.1'

 .../accumulo/tserver/tablet/MinorCompactor.java      | 20 +++++++++++++++-----
 .../org/apache/accumulo/tserver/tablet/Tablet.java   | 13 +++++++++++--
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 549331b247,1a680704fa..15e5d6dae0
--- 
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
@@@ -83,13 -91,22 +84,14 @@@ import org.apache.accumulo.core.spi.sca
  import org.apache.accumulo.core.tabletserver.log.LogEntry;
  import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
  import org.apache.accumulo.core.trace.TraceUtil;
+ import org.apache.accumulo.core.util.Halt;
  import org.apache.accumulo.core.util.Pair;
 -import org.apache.accumulo.core.volume.Volume;
 -import org.apache.accumulo.server.ServerContext;
 +import org.apache.accumulo.core.util.UtilWaitThread;
  import org.apache.accumulo.server.compaction.CompactionStats;
 -import org.apache.accumulo.server.compaction.PausedCompactionMetrics;
 -import org.apache.accumulo.server.fs.VolumeChooserEnvironmentImpl;
 -import org.apache.accumulo.server.fs.VolumeUtil;
 -import org.apache.accumulo.server.fs.VolumeUtil.TabletFiles;
 +import org.apache.accumulo.server.fs.VolumeManager;
 +import 
org.apache.accumulo.server.tablets.ConditionCheckerContext.ConditionChecker;
 +import org.apache.accumulo.server.tablets.TabletNameGenerator;
  import org.apache.accumulo.server.tablets.TabletTime;
 -import org.apache.accumulo.server.tablets.UniqueNameAllocator;
 -import org.apache.accumulo.server.util.FileUtil;
 -import org.apache.accumulo.server.util.ManagerMetadataUtil;
 -import org.apache.accumulo.server.util.MetadataTableUtil;
 -import org.apache.accumulo.tserver.ConditionCheckerContext.ConditionChecker;
  import org.apache.accumulo.tserver.InMemoryMap;
  import org.apache.accumulo.tserver.MinorCompactionReason;
  import org.apache.accumulo.tserver.TabletServer;
@@@ -405,12 -487,20 +407,19 @@@ public class Tablet extends TabletBase 
  
        Span span2 = TraceUtil.startSpan(this.getClass(), 
"minorCompact::bringOnline");
        try (Scope scope = span2.makeCurrent()) {
 -        var storedFile = 
getDatafileManager().bringMinorCompactionOnline(tmpDatafile, newDatafile,
 +        bringMinorCompactionOnline(tmpDatafile, newDatafile,
              new DataFileValue(stats.getFileSize(), 
stats.getEntriesWritten()), commitSession,
 -            flushId);
 -        storedFile.ifPresent(stf -> compactable.filesAdded());
 +            flushId, mincReason);
        } catch (Exception e) {
-         TraceUtil.setException(span2, e, true);
-         throw e;
+         final ServiceLock tserverLock = tabletServer.getLock();
+         if (tserverLock == null || !tserverLock.verifyLockAtSource()) {
+           log.error("Minor compaction of {} has failed and TabletServer lock 
does not exist."
+               + " Halting...", getExtent(), e);
+           Halt.halt("TabletServer lock does not exist", -1);
+         } else {
+           TraceUtil.setException(span2, e, true);
+           throw e;
+         }
        } finally {
          span2.end();
        }

Reply via email to