Skip to content

Commit bab34c6

Browse files
committed
bug fix: not including leader in voters array in tryadvancecommitindex
1 parent 13fd0b4 commit bab34c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/raft-core/src/core/StateMachine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ export class StateMachine implements StateMachineInterface {
12431243

12441244
const currentTerm = this.persistentState.getCurrentTerm();
12451245

1246-
const voters = this.configManager.getVoters();
1246+
const voters = this.configManager.getVoters().filter((peerId) => peerId !== this.nodeId);
12471247

12481248
const newCommitIndex = await this.leaderState.calculateCommitIndex(currentTerm, this.logManager, voters);
12491249

0 commit comments

Comments
 (0)