diff --git a/db/db_impl.cc b/db/db_impl.cc index cbb1cd53b42472d0d48abbc5afd436f2f1d173fe..84cc7b9cf70740a61305740d93d1ab1d9f147fd5 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_; }