Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/java/org/apache/cassandra/hints/HintsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,8 @@ public boolean isShutDown()
{
return isShutDown;
}
}

public boolean hasHints()
{
return catalog.hasFiles();
}}
22 changes: 15 additions & 7 deletions src/java/org/apache/cassandra/service/StorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4224,21 +4224,29 @@ private void unbootstrap(Runnable onFinish) throws ExecutionException, Interrupt

// Start with BatchLog replay, which may create hints but no writes since this is no longer a valid endpoint.
Future<?> batchlogReplay = BatchlogManager.instance.startBatchlogReplay();
Future<StreamState> streamSuccess = streamRanges(rangesToStream);

// Wait for batch log to complete before streaming hints.
logger.debug("waiting for batch log processing.");
batchlogReplay.get();

setMode(Mode.LEAVING, "streaming hints to other nodes", true);

Future hintsSuccess = streamHints();
if(HintsService.instance.hasHints())
{
Future<StreamState> streamSuccess = streamRanges(rangesToStream);
Future hintsSuccess = streamHints();

// wait for the transfer runnables to signal the latch.
logger.debug("waiting for stream acks.");
streamSuccess.get();
hintsSuccess.get();
logger.debug("stream acks all received.");
// wait for the transfer runnables to signal the latch.
logger.debug("waiting for stream acks.");
streamSuccess.get();
hintsSuccess.get();
logger.debug("stream acks all received.");
}
else
{
logger.debug("no hints on the node.");
}

leaveRing();
onFinish.run();
}
Expand Down