]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix 2PC with concurrent memtable insert
authorSiying Dong <siying.d@fb.com>
Tue, 17 Jan 2017 19:18:12 +0000 (11:18 -0800)
committersdong <siying.d@fb.com>
Fri, 20 Jan 2017 19:52:36 +0000 (11:52 -0800)
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

db/write_thread.cc

index cd3a52391547649bbf6d537d10e5141dc3a8f96f..66cec0e1b315e11967890dba54c03bcb13df08a3 100644 (file)
@@ -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;