-
Notifications
You must be signed in to change notification settings - Fork 92
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
Optimize Commit pipeline performance #286
Conversation
@Connor1996 @tabokie PTAL, thanks! |
Please add some descriptions for the new algorithm. I didn't find any on the weekly report. |
Sorry I missed the email, I've add the descriptions. Please let me know if it's clear enough, thanks! @tabokie @Connor1996 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hi @tabokie @Connor1996 I've updated a version according to your suggestions (except for the supplementary comments, which will be added later), PTAL again, thank you. |
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.
I have a few questions about how to deal with memtable write error:
- What will happen if write
WAL
successfully, but writememtable
failed? - We loop write
memtable
, according to the current logic, only the latest error is recorded, it this expected? - The current helper thread does not call WriteStatusCheck(writer.status); after helping to execute wb, is this ok? (This function is a protected member defined in class db_impl, which is more troublesome to call in write_thread.cc)
|
Got it, thanks!
I think it's OK. |
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.
I suggest adding another atomic flag persisted
to mark that a request is safe to be applied. It can solve the two issues in my comments.
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.
rest LGTM
Might need to cherry-pick to 6.29.tikv branch. |
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
- Move atomic ops into functions - Unified replacement of PebbleWrite with MultiBatchWrite - Add a few comments Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
/run-test |
* Optimize Commit pipeline performance Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Remove safe queue, iterate the wbs directly Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Refactored some code - Move atomic ops into functions - Unified replacement of PebbleWrite with MultiBatchWrite - Add a few comments Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Reset pending_wb_cnt before wakeup writers when write WAL failed Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Update db/db_impl/db_impl_write.cc Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Update db/write_thread.cc Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Refactor some code Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Fix two bugs about write memtable Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: tabokie <xy.tao@outlook.com>
* Optimize Commit pipeline performance Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Remove safe queue, iterate the wbs directly Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Refactored some code - Move atomic ops into functions - Unified replacement of PebbleWrite with MultiBatchWrite - Add a few comments Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Reset pending_wb_cnt before wakeup writers when write WAL failed Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Update db/db_impl/db_impl_write.cc Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Update db/write_thread.cc Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Refactor some code Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Fix two bugs about write memtable Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> Co-authored-by: Xinye Tao <xy.tao@outlook.com> Signed-off-by: tabokie <xy.tao@outlook.com>
This reverts commit e4bfc11. Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
* Revert "Fix SIGABRT caused by uninitialized mutex (#296)" This reverts commit 4037bda. Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> * Revert "Optimize Commit pipeline performance (#286)" This reverts commit e4bfc11. Signed-off-by: Wenbo Zhang <ethercflow@gmail.com> Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
Follow up on #267
Optimize the waiting delay caused by the uneven load of the writer wb: the writer who enters the request queue later enters the commit phase first.
Signed-off-by: Wenbo Zhang ethercflow@gmail.com