Skip to content

Commit

Permalink
Removed commented log lines, added another check for lock
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmarion committed Jan 29, 2025
1 parent 1e360fb commit e17b93f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ public CompactionStats call() {
}
}

// log.debug(String.format("MinC %,d recs in | %,d recs out | %,d recs/sec | %6.3f secs |
// %,d bytes ",map.size(), entriesCompacted,
// (int)(map.size()/((t2 - t1)/1000.0)), (t2 - t1)/1000.0, estimatedSizeInBytes()));

if (reportedProblem) {
ProblemReports.getInstance(tabletServer.getContext())
.deleteProblemReport(getExtent().tableId(), ProblemType.FILE_WRITE, outputFileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.dataImpl.thrift.MapFileInfo;
import org.apache.accumulo.core.fate.zookeeper.ServiceLock;
import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iteratorsImpl.system.SourceSwitchingIterator;
Expand All @@ -91,6 +92,7 @@
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;
Expand Down Expand Up @@ -508,8 +510,15 @@ DataFileValue minorCompact(InMemoryMap memTable, TabletFile tmpDatafile, TabletF
flushId);
storedFile.ifPresent(stf -> compactable.filesAdded(true, List.of(stf)));
} 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();
}
Expand Down

0 comments on commit e17b93f

Please sign in to comment.