Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set st to idle when block timeout #401

Merged
merged 1 commit into from
May 31, 2023

Conversation

pengchenglv
Copy link

@pengchenglv pengchenglv commented May 24, 2023

replicator blocking状态超时后,需要将状态改回idle。

if (_options.snapshot_throttle && !_options.snapshot_throttle->

if (_options.snapshot_throttle && !_options.snapshot_throttle->
                                        add_one_more_task(true)) {
    return _block(butil::gettimeofday_us(), EBUSY);
}

如果使用braft默认的SnapshotThrottle,leader在add_one_more_task一定返回true;如果用户自己实现一个SnapshotThrottle,在leader处限制安装快照的任务数,add_one_more_task可能返回false。之后进入_block函数,再也不会send_entry了

@pengchenglv
Copy link
Author

@PFZheng hi, looking forward to your review

@PFZheng PFZheng merged commit e32b78a into baidu:master May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants