From 6a859b71173b4ef692fa8bab05fcf773b9dfd524 Mon Sep 17 00:00:00 2001 From: hhwyt Date: Wed, 8 Jan 2025 11:00:25 +0800 Subject: [PATCH] Add comments --- db/db_impl/db_impl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index 7f510a5534f..f836f060c98 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -5853,7 +5853,12 @@ Status DBImpl::IngestExternalFiles( InstrumentedMutexLock l(&mutex_); TEST_SYNC_POINT("DBImpl::AddFile:MutexLock"); - // Stop writes to the DB by entering both write threads + // Stop writes to the DB by entering both write threads. + // Even with allow_write = true, writes to the DB must be temporarily + // stopped to wait for pending writes. This is because allow_write = true + // only requires users to ensure no concurrent writes overlap with the + // ingestion data and does not require ensuring no overlapping + // unordered_write before ingestion. WriteThread::Writer w; write_thread_.EnterUnbatched(&w, &mutex_); WriteThread::Writer nonmem_w;