Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
isno committed Jan 22, 2024
2 parents 1c15724 + 5e8fcc3 commit fe72305
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion consensus/raft-leader-election.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Raft 算法中,节点有三种状态:

- **leader**:领导者,接收 client(客户端)的所有请求,raft 算法中所有的操作以 leader 为准。领导者平常的工作包括 3 个部分:处理写请求,管理日志复制,不断发送心跳信息通知其他节点”我是领导者,我还活者,你们现在不要发起新的选举“。
- **follower**:跟随者,相当于普通群众,被动接收和处理来自领导者的消息。当领导者心跳超时时,就主动站出来,推荐自己当选候选人
- **candidate**:候选人,用于选举出一个新的 leader。候选人向其他节点发送投票(RequestVote RPC)消息,通知其他节点来投票,如果赢得子大多数选票,就升级为领导者。
- **candidate**:候选人,用于选举出一个新的 leader。候选人向其他节点发送投票(RequestVote RPC)消息,通知其他节点来投票,如果赢得大多数选票,就升级为领导者。


Raft 算法中,节点之间采用 RPC 进行通信,下面两种 RPC 是 Raft 基础功能的必要实现:
Expand Down

0 comments on commit fe72305

Please sign in to comment.