From: Siying Dong Date: Tue, 17 Jan 2017 19:18:12 +0000 (-0800) Subject: Fix 2PC with concurrent memtable insert X-Git-Tag: rocksdb-5.1.2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b642e94c88ba36abcc89cf6540012312605a7262;p=rocksdb.git Fix 2PC with concurrent memtable insert Summary: If concurrent memtable insert is enabled, and one prepare command and a normal command are grouped into a commit group, the sequence ID will be calculated incorrectly. Closes https://github.com/facebook/rocksdb/pull/1730 Differential Revision: D4371081 Pulled By: siying fbshipit-source-id: cd40c6d --- diff --git a/db/write_thread.cc b/db/write_thread.cc index cd3a52391..66cec0e1b 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -317,7 +317,7 @@ void WriteThread::LaunchParallelFollowers(ParallelGroup* pg, while (w != pg->last_writer) { // Writers that won't write don't get sequence allotment - if (!w->CallbackFailed()) { + if (!w->CallbackFailed() && w->ShouldWriteToMemtable()) { sequence += WriteBatchInternal::Count(w->batch); } w = w->link_newer;