Skip to content

Commit

Permalink
Remove unneccessary MutexLock from NonBatchedOpStressTest::TestGetEnt…
Browse files Browse the repository at this point in the history
…ity (facebook#12709)

Summary:
Pull Request resolved: facebook#12709

This is most likely copypasta from `TestGet` from before facebook#11058 . There is no need to lock the mutex for the key for reads; in fact, doing so is detrimental to test coverage since it locks out concurrent writers.

Reviewed By: jowlyzhang

Differential Revision: D57915207

fbshipit-source-id: eb0dbf6b84e5408b87d96dd47597511996e206a7
  • Loading branch information
ltamasi authored and facebook-github-bot committed May 29, 2024
1 parent 9cc6168 commit d931626
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions db_stress_tool/no_batched_ops_stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -901,17 +901,14 @@ class NonBatchedOpsStressTest : public StressTest {
assert(shared);

assert(!rand_column_families.empty());
assert(!rand_keys.empty());

std::unique_ptr<MutexLock> lock(new MutexLock(
shared->GetMutexForKey(rand_column_families[0], rand_keys[0])));

assert(rand_column_families[0] >= 0);
assert(rand_column_families[0] < static_cast<int>(column_families_.size()));

ColumnFamilyHandle* const cfh = column_families_[rand_column_families[0]];
assert(cfh);

assert(!rand_keys.empty());

const std::string key = Key(rand_keys[0]);

PinnableWideColumns columns_from_db;
Expand Down

0 comments on commit d931626

Please sign in to comment.