installSnapshotState.markSendStatus(false);
}
- if (wasLastChunk && !context.getSnapshotManager().isCapturing()) {
- // Since the follower is now caught up try to purge the log.
- purgeInMemoryLog();
- } else if (!wasLastChunk && installSnapshotState.canSendNextChunk()) {
+ if (wasLastChunk) {
+ if (!context.getSnapshotManager().isCapturing()) {
+ // Since the follower is now caught up try to purge the log.
+ purgeInMemoryLog();
+ }
+ } else {
ActorSelection followerActor = context.getPeerActorSelection(followerId);
if (followerActor != null) {
sendSnapshotChunk(followerActor, followerLogInformation);
// Ensure the snapshot bytes are set - this is a no-op.
installSnapshotState.setSnapshotBytes(snapshotHolder.get().getSnapshotBytes());
+ if (!installSnapshotState.canSendNextChunk()) {
+ return;
+ }
+
byte[] nextSnapshotChunk = installSnapshotState.getNextChunk();
log.debug("{}: next snapshot chunk size for follower {}: {}", logName(), followerLogInfo.getId(),