-
Notifications
You must be signed in to change notification settings - Fork 312
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
fix(duplication): deal with plog concurrent problem #2068
base: master
Are you sure you want to change the base?
fix(duplication): deal with plog concurrent problem #2068
Conversation
for (const auto &pr : file_map) { | ||
decree cleanable_decree = _private_log->get_cleanable_decree(); | ||
decree max_decree_gpid = _private_log->max_decree(get_gpid()); | ||
if (max_decree_gpid <= cleanable_decree) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible? CHECK
it if it's impossible.
return; | ||
} | ||
|
||
for (auto it = file_map.rbegin(); it != file_map.rend(); ++it) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use const reference?
new_file_map.emplace(pr.first, file); | ||
new_file_map.emplace(it->first, file); | ||
|
||
// next file map may can not open |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upper the first letter and add a dot at the end. Other places are the same.
And which code line does this comment for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. And this comment is the same meaning with line 181. So I deleted it.
// next file map may can not open | ||
gpid pid = get_gpid(); | ||
decree previous_log_max_decree = file->previous_log_max_decree(pid); | ||
// these plog_file has possible be deleted do not open_read next plog_file , otherwise it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is plog_file
? Why you add a underline?
3db3bd1
to
f030a9e
Compare
What problem does this PR solve?
#2014
What is changed and how does it work?
Old logic: If some file open with err
ERR_FILE_OPERATION_FAILED
, the others file could as a paramater to build a log_file object. However, plog GC thread can remove the file between those two actiion.(Just as the condition following...)New logic: Add some judgement logic in
find_log_file_to_start
to prevent those plog (which has possible already be removed) fromopen_read
.Tests