Skip to content

Commit b694d6c

Browse files
committed
Merge branch '3.1'
2 parents bbdee9f + c385086 commit b694d6c

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java

+7
Original file line numberDiff line numberDiff line change
@@ -371,4 +371,11 @@ public void startServiceLockVerificationThread() {
371371
@Override
372372
public void close() {}
373373

374+
protected void waitForUpgrade() throws InterruptedException {
375+
while (AccumuloDataVersion.getCurrentVersion(getContext()) < AccumuloDataVersion.get()) {
376+
log.info("Waiting for upgrade to complete.");
377+
Thread.sleep(1000);
378+
}
379+
}
380+
374381
}

server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java

+8
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ boolean inSafeMode() {
154154
@Override
155155
@SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit")
156156
public void run() {
157+
158+
try {
159+
waitForUpgrade();
160+
} catch (InterruptedException e) {
161+
log.error("Interrupted while waiting for upgrade to complete, exiting...");
162+
System.exit(1);
163+
}
164+
157165
final VolumeManager fs = getContext().getVolumeManager();
158166

159167
// Sleep for an initial period, giving the manager time to start up and

server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
import com.google.common.collect.Sets;
134134
import com.google.common.net.HostAndPort;
135135

136+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
137+
136138
public class ScanServer extends AbstractServer
137139
implements TabletScanClientService.Iface, TabletHostingServer {
138140

@@ -361,15 +363,24 @@ private ServiceLock announceExistence() {
361363
}
362364

363365
@Override
366+
@SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit")
364367
public void run() {
368+
369+
try {
370+
waitForUpgrade();
371+
} catch (InterruptedException e) {
372+
LOG.error("Interrupted while waiting for upgrade to complete, exiting...");
373+
System.exit(1);
374+
}
375+
365376
SecurityUtil.serverLogin(getConfiguration());
366377

367378
ServerAddress address = null;
368379
try {
369380
address = startScanServerClientService();
370381
clientAddress = address.getAddress();
371382
} catch (UnknownHostException e1) {
372-
throw new RuntimeException("Failed to start the compactor client service", e1);
383+
throw new RuntimeException("Failed to start the scan server client service", e1);
373384
}
374385

375386
MetricsInfo metricsInfo = getContext().getMetricsInfo();

0 commit comments

Comments
 (0)