More than one leader in the same term?

57 views
Skip to first unread message

yc c

unread,
Jun 16, 2021, 6:26:21 AM6/16/21
to raft-dev

 Log replication

Seeing the realization of sofa-raft, how did this scenario happen?

if (!serverId.equals(this.leaderId)) {
LOG.error("Another peer {} declares that it is the leader at term {} which was occupied by leader {}.",
serverId, this.currTerm, this.leaderId);
// Increase the term by 1 and make both leaders step down to minimize the  loss of split brain
stepDown(request.getTerm() + 1, false, new Status(RaftError.ELEADERCONFLICT,
"More than one leader in the same term."));
return AppendEntriesResponse.newBuilder() //
.setSuccess(false) //
.setTerm(request.getTerm() + 1) //
.build();

}
Reply all
Reply to author
Forward
0 new messages