Commit 4f50a671 authored by Bereng's avatar Bereng Committed by Brandon Williams

Catch exception on bootstrap resume and init native transport

Patch by Berenguer Blasi, reviewed by brandonwilliams for CASSANDRA-15863
parent 408f969f
......@@ -2,6 +2,7 @@
* Fix CQL formatting of read command restrictions for slow query log (CASSANDRA-15503)
* Allow sstableloader to use SSL on the native port (CASSANDRA-14904)
Merged from 3.0:
* Catch exception on bootstrap resume and init native transport (CASSANDRA-15863)
* Fix replica-side filtering returning stale data with CL > ONE (CASSANDRA-8272, CASSANDRA-8273)
* Fix duplicated row on 2.x upgrades when multi-rows range tombstones interact with collection ones (CASSANDRA-15805)
* Rely on snapshotted session infos on StreamResultFuture.maybeComplete to avoid race conditions (CASSANDRA-15667)
......
......@@ -450,7 +450,8 @@ public class CassandraDaemon
public void initializeNativeTransport()
{
// Native transport
nativeTransportService = new NativeTransportService();
if (nativeTransportService == null)
nativeTransportService = new NativeTransportService();
}
/*
......
......@@ -1592,22 +1592,30 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
@Override
public void onSuccess(StreamState streamState)
{
bootstrapFinished();
// start participating in the ring.
// pretend we are in survey mode so we can use joinRing() here
if (isSurveyMode)
try
{
logger.info("Startup complete, but write survey mode is active, not becoming an active ring member. Use JMX (StorageService->joinRing()) to finalize ring joining.");
bootstrapFinished();
if (isSurveyMode)
{
logger.info("Startup complete, but write survey mode is active, not becoming an active ring member. Use JMX (StorageService->joinRing()) to finalize ring joining.");
}
else
{
isSurveyMode = false;
progressSupport.progress("bootstrap", ProgressEvent.createNotification("Joining ring..."));
finishJoiningRing(true, bootstrapTokens);
}
progressSupport.progress("bootstrap", new ProgressEvent(ProgressEventType.COMPLETE, 1, 1, "Resume bootstrap complete"));
if (!isNativeTransportRunning())
daemon.initializeNativeTransport();
daemon.start();
logger.info("Resume complete");
}
else
catch(Exception e)
{
isSurveyMode = false;
progressSupport.progress("bootstrap", ProgressEvent.createNotification("Joining ring..."));
finishJoiningRing(true, bootstrapTokens);
onFailure(e);
throw e;
}
progressSupport.progress("bootstrap", new ProgressEvent(ProgressEventType.COMPLETE, 1, 1, "Resume bootstrap complete"));
daemon.start();
logger.info("Resume complete");
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment