WritePrepared: fix race condition on GetSnapshotListFromDB (#4872)

Summary:
Fixes a typo that made mutex_ to remain unlocked when GetSnapshotListFromDB called from WritePreparedTxnDB.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4872

Differential Revision: D13640381

Pulled By: maysamyabandeh

fbshipit-source-id: 50f6600568f9092b4b43115f6ebd96e6c7388ad7
main
Maysam Yabandeh 6 years ago committed by Facebook Github Bot
parent 6a4ec41fed
commit 856ac24484
  1. 3
      utilities/transactions/write_prepared_txn_db.cc

@ -567,7 +567,8 @@ const Snapshot* WritePreparedTxnDB::GetSnapshot() {
const std::vector<SequenceNumber> WritePreparedTxnDB::GetSnapshotListFromDB(
SequenceNumber max) {
ROCKS_LOG_DETAILS(info_log_, "GetSnapshotListFromDB with max %" PRIu64, max);
InstrumentedMutex(db_impl_->mutex());
InstrumentedMutexLock dblock(db_impl_->mutex());
db_impl_->mutex()->AssertHeld();
return db_impl_->snapshots().GetAll(nullptr, max);
}

Loading…
Cancel
Save