-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport to the 2.0.5 branch] [#3519] Fix data race between ~Tablet …
…and yb::tablet::Tablet::RegularDbFilesChanged() Summary: DBImpl invokes FilesChanged after decrementing the number of background flushes and unlocking the mutex in BackgroundCallFlush. So we could get into a situation when DBImpl destructor already thinks that the background job is done. But we are calling FilesChanged and it will be invoked for a destroyed RocksDB, that will call the callback on a destroyed Tablet. Fixed by calling FilesChanged before decrementing number of background flushes. Did the same in BackgroundCallCompaction. Also moved TaskPriorityUpdater.Apply to the same place. It was safe invoke it from that place, but brought confusion that other code could be placed nearby. Test Plan: ybd tsan --cxx-test client_ql-tablet-test --gtest_filter QLTabletTest.SkewedClocks -n 100 -- -p 4 Jenkins: auto rebase: no Reviewers: bogdan Reviewed By: bogdan Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D8322
- Loading branch information
Showing
2 changed files
with
105 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters