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:
parent
6a4ec41fed
commit
856ac24484
@ -567,7 +567,8 @@ const Snapshot* WritePreparedTxnDB::GetSnapshot() {
|
|||||||
const std::vector<SequenceNumber> WritePreparedTxnDB::GetSnapshotListFromDB(
|
const std::vector<SequenceNumber> WritePreparedTxnDB::GetSnapshotListFromDB(
|
||||||
SequenceNumber max) {
|
SequenceNumber max) {
|
||||||
ROCKS_LOG_DETAILS(info_log_, "GetSnapshotListFromDB with max %" PRIu64, 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);
|
return db_impl_->snapshots().GetAll(nullptr, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user