Skip to content

Commit

Permalink
Implement suggestion, remove race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmarion committed Dec 16, 2024
1 parent 1af1fd1 commit 1d9e34f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.fate.zookeeper.ServiceLock;
import org.apache.accumulo.core.manager.state.tables.TableState;
import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.util.Halt;
Expand Down Expand Up @@ -98,7 +99,8 @@ public CompactionStats call() {
try {
ret = super.call();
} catch (Exception e) {
if (tabletServer.getLock() == null || !tabletServer.getLock().verifyLockAtSource()) {
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);
Expand Down

0 comments on commit 1d9e34f

Please sign in to comment.