- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.2k
 
Open
Description
在发布1台follower过程中,follower启动后,leader推送log entry非常快,读请求会广播心跳到所有follower,SendEntries会频繁持有锁和handleReadIndexRequest广播心跳竞争锁,导致leader卡住。
调用链路:
NodeImpl.handleReadIndexRequest().readLock-->NodeImpl.readLeader()-->
ReplicatorGroupImpl.sendHeartbeat()-->Replicator.sendHeartbeat()-->ThreadId.lock()
每个peer一个Replicator,正在启动追数据的follower频繁持有锁,竞争等待
NodeImpl.handleReadIndexRequest().readLock会阻塞executeApplyingTasks() writeLock.lock
从而处理能力急剧下降,导致leader任务返回response超时。
1.请问这是是否需要代码优化
2.发布流程是否先发布1台learner,等数据追上,再将此机器晋升为follower,是否有发布标准可供参考
谢谢
Metadata
Metadata
Assignees
Labels
No labels