-
Notifications
You must be signed in to change notification settings - Fork 95
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 SIGABRT caused by uninitialized mutex #296
Conversation
@Connor1996 @tabokie PTAL, thanks! |
db/write_thread.h
Outdated
@@ -185,6 +185,7 @@ class WriteThread { | |||
CommitRequest* request; | |||
SequenceNumber sequence; // the sequence number to use for the first key | |||
Status status; | |||
std::mutex status_mu; |
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.
You should figure out another solution. Maybe spinlock? Each write creates a writer, this puts too much load on futex infrastructure (last I checked each futex creation insert to a global kernel map).
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.
Needs to add a new method for reading status. There're a lot of places that read status using db_mutex.
I don't think it's needed because |
Signed-off-by: Wenbo Zhang <[email protected]>
Signed-off-by: Wenbo Zhang <[email protected]>
Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]>
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.
why the mutex is uninitiliazed
As this |
Not deep dive into the code, can we call |
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.
LGTM
* Fix SIGABRT caused by uninitialized mutex Signed-off-by: Wenbo Zhang <[email protected]> * Use spinlock instead of mutex to reduce writer ctor cost Signed-off-by: Wenbo Zhang <[email protected]> * Update db/write_thread.h Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]> Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]>
* Fix SIGABRT caused by uninitialized mutex Signed-off-by: Wenbo Zhang <[email protected]> * Use spinlock instead of mutex to reduce writer ctor cost Signed-off-by: Wenbo Zhang <[email protected]> * Update db/write_thread.h Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]> Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]> Co-authored-by: Xinye Tao <[email protected]>
This reverts commit 4037bda. Signed-off-by: Wenbo Zhang <[email protected]>
* Revert "Fix SIGABRT caused by uninitialized mutex (#296)" This reverts commit 4037bda. Signed-off-by: Wenbo Zhang <[email protected]> * Revert "Optimize Commit pipeline performance (#286)" This reverts commit e4bfc11. Signed-off-by: Wenbo Zhang <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]>
Implement multi batches write Signed-off-by: v01dstar <[email protected]> Fix SIGABRT caused by uninitialized mutex (tikv#296) (tikv#298) * Fix SIGABRT caused by uninitialized mutex Signed-off-by: Wenbo Zhang <[email protected]> * Use spinlock instead of mutex to reduce writer ctor cost Signed-off-by: Wenbo Zhang <[email protected]> * Update db/write_thread.h Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]> Co-authored-by: Xinye Tao <[email protected]> Signed-off-by: Wenbo Zhang <[email protected]> Co-authored-by: Xinye Tao <[email protected]>
Fixed bug where wrong use of uninitialized Mutex caused SIGABRT.
Signed-off-by: Wenbo Zhang [email protected]