baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.86k stars 865 forks source link

block in replicator's _install_snapshot #402

Open CkTD opened 1 year ago

CkTD commented 1 year ago

https://github.com/baidu/braft/blob/e32b78a1f4973534aaa047dc2ead9167ec091b56/src/braft/replicator.cpp#L779-L788

看注释,replicator 先把状态设置为 INSTALLING_SNAPSHOT,让后面的 throttle 等触发的 _block 可以正常执行。 但是实际 throttle 调用 _block 是在设置 INSTALLING_SNAPSHOT 前,这样会不会有问题?