diff --git a/db/write_thread.cc b/db/write_thread.cc index 36bda43fb..c74b7b0ed 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -438,6 +438,7 @@ size_t WriteThread::EnterAsBatchGroupLeader(Writer* leader, // (newest_writer) is inclusive. Iteration goes from old to new. Writer* w = leader; while (w != newest_writer) { + assert(w->link_newer); w = w->link_newer; if (w->sync && !leader->sync) { @@ -512,6 +513,7 @@ void WriteThread::EnterAsMemTableWriter(Writer* leader, Writer* w = leader; while (w != newest_writer) { + assert(w->link_newer); w = w->link_newer; if (w->batch == nullptr) { @@ -568,6 +570,7 @@ void WriteThread::ExitAsMemTableWriter(Writer* /*self*/, if (w == last_writer) { break; } + assert(next); w = next; } // Note that leader has to exit last, since it owns the write group. @@ -721,6 +724,7 @@ void WriteThread::ExitAsBatchGroupLeader(WriteGroup& write_group, // leader now while (last_writer != leader) { + assert(last_writer); last_writer->status = status; // we need to read link_older before calling SetState, because as soon // as it is marked committed the other thread's Await may return and