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
WriteThread::EnterAsBatchGroupLeader reorder writers #12138
Conversation
5da05e2
to
fc8c5df
Compare
@siying @ajkr @igorcanadi @riversand963 @IslamAbdelRahman @maysamyabandeh |
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.
Makes sense. Thanks!
db/write_thread.cc
Outdated
// @leader, n1, *n2, n3, *newest_writer | ||
// @leader, *n2, n3, *newest_writer, n1 | ||
// @leader, @n2, n3, *newest_writer, n1 | ||
// @leader, @n2, @newest_writer, n1, n3 | ||
// case A | ||
// @leader, @n2, @newest_writer, n1, n3 | ||
// case B | ||
// @leader, @n2, @newest_writer, n4 n1, n3 | ||
// @leader, @n2, @newest_writer, n1, n3, n4 |
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.
Could you please describe the notation above the comment?
My understanding is
- Each line before the "case"s is the state at the beginning of an iteration of the while-loop
- Each "case" is a possible state at the end of the function
- Items prefixed by
@
have been included inwrite_group
- Items prefixed by
*
share the same options aswrite_group
, but have not been included yet - Items after several spaces are in
r_list
, temporarily separated from the main list
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. Let me know if you disagree with any of the changes I made.
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@mm304321141 has updated the pull request. You must reimport the pull request before landing. |
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@mm304321141 has updated the pull request. You must reimport the pull request before landing. |
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Reorder writers list to allow a leader can take as more commits as possible to maximize the throughput of the system and reduce IOPS.