Skip to content

Commit

Permalink
[Java] Reset ClusterBackup state if the Cluster node from which Clust…
Browse files Browse the repository at this point in the history
…erBackup is replaying the log is not "available", i.e. either is no longer eligible (i.e. after an election) or the backup query cannot be sent to it (e.g. ConsensusModule is down).

This ensures that all the data received by the ClusterBackup is coming from a single source. Previously it was possible to get a replay from one Cluster node while getting snapshots and updating RecordingLog using another node.
  • Loading branch information
vyazelenko committed Feb 7, 2025
1 parent 72f8e4e commit 6674ab9
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,12 @@ private void onBackupResponse(
else if (!logSourceValidator.isAcceptable(leaderMemberId, memberId))
{
consensusPublicationGroup.closeAndExcludeCurrent();
if (null != logSupplierMember && logSupplierMember.id() == memberId)
{
// we can no longer replay from the current node due to the role change
state(RESET_BACKUP, epochClock.time());
}
else
{
// just query another node
timeOfLastBackupQueryMs = 0;
}
state(RESET_BACKUP, epochClock.time());
return;
}
else if (null != logSupplierMember && logSupplierMember.id() != memberId)
{
state(RESET_BACKUP, epochClock.time());
return;
}

Expand Down

0 comments on commit 6674ab9

Please sign in to comment.