Skip to content

Commit

Permalink
Remove unneccessary MutexLock from NonBatchedOpStressTest::TestGetEntity
Browse files Browse the repository at this point in the history
Summary: 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.

Differential Revision: D57915207
  • Loading branch information
ltamasi authored and facebook-github-bot committed May 29, 2024
1 parent 9cc6168 commit 18a6f6b
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 18a6f6b

Please sign in to comment.