|
65 | 65 | import org.apache.accumulo.core.data.Value;
|
66 | 66 | import org.apache.accumulo.core.dataImpl.KeyExtent;
|
67 | 67 | import org.apache.accumulo.core.dataImpl.thrift.MapFileInfo;
|
| 68 | +import org.apache.accumulo.core.fate.zookeeper.ServiceLock; |
68 | 69 | import org.apache.accumulo.core.file.FileOperations;
|
69 | 70 | import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
|
70 | 71 | import org.apache.accumulo.core.iteratorsImpl.system.SourceSwitchingIterator;
|
|
91 | 92 | import org.apache.accumulo.core.tabletserver.log.LogEntry;
|
92 | 93 | import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
|
93 | 94 | import org.apache.accumulo.core.trace.TraceUtil;
|
| 95 | +import org.apache.accumulo.core.util.Halt; |
94 | 96 | import org.apache.accumulo.core.util.Pair;
|
95 | 97 | import org.apache.accumulo.core.volume.Volume;
|
96 | 98 | import org.apache.accumulo.server.ServerContext;
|
@@ -508,8 +510,15 @@ DataFileValue minorCompact(InMemoryMap memTable, TabletFile tmpDatafile, TabletF
|
508 | 510 | flushId);
|
509 | 511 | storedFile.ifPresent(stf -> compactable.filesAdded(true, List.of(stf)));
|
510 | 512 | } catch (Exception e) {
|
511 |
| - TraceUtil.setException(span2, e, true); |
512 |
| - throw e; |
| 513 | + final ServiceLock tserverLock = tabletServer.getLock(); |
| 514 | + if (tserverLock == null || !tserverLock.verifyLockAtSource()) { |
| 515 | + log.error("Minor compaction of {} has failed and TabletServer lock does not exist." |
| 516 | + + " Halting...", getExtent(), e); |
| 517 | + Halt.halt("TabletServer lock does not exist", -1); |
| 518 | + } else { |
| 519 | + TraceUtil.setException(span2, e, true); |
| 520 | + throw e; |
| 521 | + } |
513 | 522 | } finally {
|
514 | 523 | span2.end();
|
515 | 524 | }
|
|
0 commit comments