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

执行truncate suffix的时候没有将last_segment从 _segment中移除 #271

Open
lintanghui opened this issue Mar 25, 2021 · 1 comment

Comments

@lintanghui
Copy link
Contributor

lintanghui commented Mar 25, 2021

当前raftlog 文件列表 包含
log_0-10, log_11_20, log_21_30, log_inprogress_31
此时执行truncate_suffix(15). 执行完成后文件列表变为
log_0_10, log_inprogress_11
此时执行SegmentLogStorage->segments() 会返回两个 log_0_10, 和log_inprogress两个文件。正常情况下 应该将 log_inprogress_11从_segments 里移除
https://github.com/baidu/braft/blob/master/src/braft/log.cpp#L930 这里swap的时候还需要 _segments.erase(last_segment->first_index());

@lintanghui
Copy link
Contributor Author

#293

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