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

block in replicator's _install_snapshot #402

Open
CkTD opened this issue Jun 9, 2023 · 0 comments
Open

block in replicator's _install_snapshot #402

CkTD opened this issue Jun 9, 2023 · 0 comments

Comments

@CkTD
Copy link

CkTD commented Jun 9, 2023

if (_options.snapshot_throttle && !_options.snapshot_throttle->
add_one_more_task(true)) {
return _block(butil::gettimeofday_us(), EBUSY);
}
// pre-set replicator state to INSTALLING_SNAPSHOT, so replicator could be
// blocked if something is wrong, such as throttled for a period of time
_st.st = INSTALLING_SNAPSHOT;

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

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

No branches or pull requests

1 participant