Skip to content

发布follower导致leader卡住15秒 #1232

@nickname11111234

Description

@nickname11111234

在发布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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions