|
29 | 29 |
|
30 | 30 | import org.apache.accumulo.core.conf.AccumuloConfiguration;
|
31 | 31 | import org.apache.accumulo.core.data.ByteSequence;
|
| 32 | +import org.apache.accumulo.core.lock.ServiceLock; |
32 | 33 | import org.apache.accumulo.core.manager.state.tables.TableState;
|
33 | 34 | import org.apache.accumulo.core.metadata.ReferencedTabletFile;
|
| 35 | +import org.apache.accumulo.core.util.Halt; |
34 | 36 | import org.apache.accumulo.core.util.LocalityGroupUtil;
|
35 | 37 | import org.apache.accumulo.server.compaction.CompactionStats;
|
36 | 38 | import org.apache.accumulo.server.compaction.FileCompactor;
|
@@ -89,11 +91,19 @@ public CompactionStats call() {
|
89 | 91 | try {
|
90 | 92 | do {
|
91 | 93 | try {
|
92 |
| - CompactionStats ret = super.call(); |
93 |
| - |
94 |
| - // log.debug(String.format("MinC %,d recs in | %,d recs out | %,d recs/sec | %6.3f secs | |
95 |
| - // %,d bytes ",map.size(), entriesCompacted, |
96 |
| - // (int)(map.size()/((t2 - t1)/1000.0)), (t2 - t1)/1000.0, estimatedSizeInBytes())); |
| 94 | + CompactionStats ret = null; |
| 95 | + try { |
| 96 | + ret = super.call(); |
| 97 | + } catch (Exception e) { |
| 98 | + final ServiceLock tserverLock = tabletServer.getLock(); |
| 99 | + if (tserverLock == null || !tserverLock.verifyLockAtSource()) { |
| 100 | + log.error("Minor compaction of {} has failed and TabletServer lock does not exist." |
| 101 | + + " Halting...", getExtent(), e); |
| 102 | + Halt.halt("TabletServer lock does not exist", -1); |
| 103 | + } else { |
| 104 | + throw e; |
| 105 | + } |
| 106 | + } |
97 | 107 |
|
98 | 108 | return ret;
|
99 | 109 | } catch (IOException | UnsatisfiedLinkError e) {
|
|
0 commit comments