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
This commit is contained in:
Maysam Yabandeh 2019-01-11 13:39:26 -08:00 committed by Facebook Github Bot
parent 6a4ec41fed
commit 856ac24484

View File

@ -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);
}