-
Notifications
You must be signed in to change notification settings - Fork 93
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 deadlock between Flush and UnregisterDB #349
Conversation
Signed-off-by: SpadeA-Tang <[email protected]>
memtable/write_buffer_manager.cc
Outdated
@@ -174,6 +178,7 @@ void WriteBufferManager::FreeMemWithCache(size_t mem) { | |||
#endif // ROCKSDB_LITE | |||
} | |||
|
|||
// Must be called without holding db mutex. |
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.
This is not entirely correct. The lock of this_db
(if not null) must be held.
memtable/write_buffer_manager.cc
Outdated
@@ -99,6 +102,7 @@ void WriteBufferManager::UnregisterColumnFamily(ColumnFamilyHandle* cf) { | |||
MaybeFlushLocked(); | |||
} | |||
|
|||
// Must be called without holding db mutex. |
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.
This is wrong.
memtable/write_buffer_manager.cc
Outdated
@@ -73,6 +73,7 @@ void WriteBufferManager::SetFlushSize(size_t new_size) { | |||
} | |||
} | |||
|
|||
// Must be called without holding db mutex. |
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.
Comment should be placed in header file.
Signed-off-by: SpadeA-Tang <[email protected]>
Signed-off-by: SpadeA-Tang <[email protected]>
Signed-off-by: SpadeA-Tang <[email protected]>
I discovered some comments are already in header file, I removed the redundancies. PTAL again @tabokie thanks. |
Signed-off-by: SpadeA-Tang <[email protected]>
Signed-off-by: SpadeA-Tang <[email protected]>
Signed-off-by: SpadeA-Tang <[email protected]> Signed-off-by: Yang Zhang <[email protected]>
Signed-off-by: SpadeA-Tang <[email protected]> Signed-off-by: Yang Zhang <[email protected]>
The caller of
MaybeFlushLocked
should be called without holding db mutex.