add locking around calls to RecalculateWriteStallConditions in column_family_test#4474
add locking around calls to RecalculateWriteStallConditions in column_family_test#4474miasantreble wants to merge 3 commits intofacebook:masterfrom
Conversation
RecalculateWriteStallConditions in column_family_test
riversand963
left a comment
There was a problem hiding this comment.
Overall LGTM.
It looks to me that in unit tests, we always need to hold the mutex when updating the statistics after cac87fc. I'm thinking maybe we should add a new function to ColumnFamilyTest that looks similar to the following:
void RecalculateWriteStallConditions(cfd, mutable_cf_options) {
dbfull()->TEST_LockMutex();
cfd->RecalculateWriteStallConditions(mutable_cf_options);
dbfull()-> TEST_UnlockMutex();
}
What do you think?
|
@riversand963 sounds like a good plan |
facebook-github-bot
left a comment
There was a problem hiding this comment.
miasantreble has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
riversand963
left a comment
There was a problem hiding this comment.
LGTM again with a minor comment.
|
|
||
| void RecalculateWriteStallConditions(ColumnFamilyData* cfd, | ||
| const MutableCFOptions& mutable_cf_options) { | ||
| dbfull()->TEST_LockMutex(); |
There was a problem hiding this comment.
I should have mentioned this in the previous comment. Maybe it's helpful to add a brief explanation about why we need the lock here? Just mention which thread is also accessing the stats data structure.
facebook-github-bot
left a comment
There was a problem hiding this comment.
miasantreble has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
this should fix the current failing TSAN jobs:
The callstack for TSAN: