Skip to content

Commit c385086

Browse files
committed
Merge branch '2.1' into 3.1
2 parents 17c69d7 + 763367f commit c385086

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,11 @@ public void startServiceLockVerificationThread() {
276276
@Override
277277
public void close() {}
278278

279+
protected void waitForUpgrade() throws InterruptedException {
280+
while (AccumuloDataVersion.getCurrentVersion(getContext()) < AccumuloDataVersion.get()) {
281+
LOG.info("Waiting for upgrade to complete.");
282+
Thread.sleep(1000);
283+
}
284+
}
285+
279286
}

server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java

+9
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
import com.google.common.net.HostAndPort;
105105
import com.google.common.util.concurrent.Uninterruptibles;
106106

107+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
107108
import io.micrometer.core.instrument.Tag;
108109

109110
public class CompactionCoordinator extends AbstractServer implements
@@ -259,8 +260,16 @@ protected Collection<Tag> getServiceTags(HostAndPort clientAddress) {
259260
}
260261

261262
@Override
263+
@SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit")
262264
public void run() {
263265

266+
try {
267+
waitForUpgrade();
268+
} catch (InterruptedException e) {
269+
LOG.error("Interrupted while waiting for upgrade to complete, exiting...");
270+
System.exit(1);
271+
}
272+
264273
ServerAddress coordinatorAddress = null;
265274
try {
266275
coordinatorAddress = startCoordinatorClientService();

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

+8
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ boolean inSafeMode() {
140140
@Override
141141
@SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit")
142142
public void run() {
143+
144+
try {
145+
waitForUpgrade();
146+
} catch (InterruptedException e) {
147+
LOG.error("Interrupted while waiting for upgrade to complete, exiting...");
148+
System.exit(1);
149+
}
150+
143151
final VolumeManager fs = getContext().getVolumeManager();
144152

145153
// 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
@@ -132,6 +132,8 @@
132132
import com.google.common.collect.Sets;
133133
import com.google.common.net.HostAndPort;
134134

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

@@ -375,15 +377,24 @@ private ServiceLock announceExistence() {
375377
}
376378

377379
@Override
380+
@SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit")
378381
public void run() {
382+
383+
try {
384+
waitForUpgrade();
385+
} catch (InterruptedException e) {
386+
LOG.error("Interrupted while waiting for upgrade to complete, exiting...");
387+
System.exit(1);
388+
}
389+
379390
SecurityUtil.serverLogin(getConfiguration());
380391

381392
ServerAddress address = null;
382393
try {
383394
address = startScanServerClientService();
384395
clientAddress = address.getAddress();
385396
} catch (UnknownHostException e1) {
386-
throw new RuntimeException("Failed to start the compactor client service", e1);
397+
throw new RuntimeException("Failed to start the scan server client service", e1);
387398
}
388399

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

0 commit comments

Comments
 (0)