diff --git a/db/db_impl.cc b/db/db_impl.cc index cbb1cd53b..84cc7b9cf 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -1618,7 +1618,9 @@ void DBImpl::ReleaseSnapshot(const Snapshot* s) { snapshots_.Delete(casted_s); uint64_t oldest_snapshot; if (snapshots_.empty()) { - oldest_snapshot = versions_->LastSequence(); + oldest_snapshot = concurrent_prepare_ && seq_per_batch_ + ? versions_->LastToBeWrittenSequence() + : versions_->LastSequence(); } else { oldest_snapshot = snapshots_.oldest()->number_; }