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

decrease _next_index when when the request with the minimum log #447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ehds
Copy link
Contributor

@ehds ehds commented Apr 7, 2024

issue: #421


[ RUN      ] NodeTestWithPipelineReplication/NodeTest.change_peers_chaos_with_snapshot/0
F20240403 18:24:26.618824 18633 log_manager.cpp:321] Can't truncate logs before _applied_id=692, last_log_kept=0

当且仅当具有最小日志 index 的 send entries 的请求不匹配时,才去缩小 _next_index.
当 pipeline 开启,但是 cache 未开启时,具有较大日志的请求如果先被处理,response->success = false, 导致 _next_index 被缩小,如果此时 follower 节点加载了快照,那么 _next_index 有可能会小于快照的 last_log_index, 从而导致后续的复制都失败。

这里限制只有当最小的复制请求的日志不匹配时才有资格缩减 _next_index.

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.

None yet

1 participant