From b77007df8b4078e9148ab45795fe2e2ad92512cd Mon Sep 17 00:00:00 2001 From: fangchenliaohui Date: Thu, 1 Dec 2016 09:46:43 -0800 Subject: [PATCH] Bug: paralle_group status updated in WriteThread::CompleteParallelWorker Summary: Multi-write thread may update the status of the parallel_group in WriteThread::CompleteParallelWorker if the status of Writer is not ok! When copy write status to the paralle_group, the write thread just hold the mutex of the the writer processed by itself. it is useless. The thread should held the the leader of the parallel_group instead. Closes https://github.com/facebook/rocksdb/pull/1598 Differential Revision: D4252335 Pulled By: siying fbshipit-source-id: 3864cf7 --- db/write_thread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/write_thread.cc b/db/write_thread.cc index face62911..cd3a52391 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -333,7 +333,7 @@ bool WriteThread::CompleteParallelWorker(Writer* w) { auto* pg = w->parallel_group; if (!w->status.ok()) { - std::lock_guard guard(w->StateMutex()); + std::lock_guard guard(pg->leader->StateMutex()); pg->status = w->status; }