MB-20798: Update queueDirty options in prep for a new option 82/67582/16
authorJim Walker <jim@couchbase.com>
Tue, 13 Sep 2016 19:51:32 +0000 (20:51 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 12 Oct 2016 07:42:30 +0000 (07:42 +0000)
Switch the bool 'genBySeqno' to a more descriptive enum, call
site will now be clearer regarding the parameter.

Change-Id: I2d6707df0360f02f7455b480383f5ca9d6e64261
Reviewed-on: http://review.couchbase.org/67582
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/checkpoint.cc
src/checkpoint.h
src/ep.cc
src/ep.h
src/ep_types.h [new file with mode: 0644]
src/vbucket.h
tests/module_tests/checkpoint_test.cc

index 7d52a62..0a0f522 100644 (file)
@@ -964,8 +964,9 @@ std::vector<std::string> CheckpointManager::getListOfCursorsToDrop() {
     return cursorsToDrop;
 }
 
-bool CheckpointManager::queueDirty(const RCPtr<VBucket> &vb, queued_item& qi,
-                                   bool genSeqno) {
+bool CheckpointManager::queueDirty(const RCPtr<VBucket> &vb,
+                                   queued_item& qi,
+                                   const GenerateBySeqno generateBySeqno) {
     LockHolder lh(queueLock);
     if (!vb) {
         throw std::invalid_argument("CheckpointManager::queueDirty: vb must "
@@ -993,7 +994,7 @@ bool CheckpointManager::queueDirty(const RCPtr<VBucket> &vb, queued_item& qi,
                     ") is not active. This is not expected. vb:" +
                     std::to_string(vb->getId()) +
                     " lastBySeqno:" + std::to_string(lastBySeqno) +
-                    " genSeqno:" + std::to_string(genSeqno));
+                    " genSeqno:" + to_string(generateBySeqno));
         }
     }
 
@@ -1004,7 +1005,7 @@ bool CheckpointManager::queueDirty(const RCPtr<VBucket> &vb, queued_item& qi,
                 ") is not OPEN");
     }
 
-    if (genSeqno) {
+    if (GenerateBySeqno::Yes == generateBySeqno) {
         qi->setBySeqno(++lastBySeqno);
         checkpointList.back()->setSnapshotEndSeqno(lastBySeqno);
     } else {
@@ -1020,7 +1021,7 @@ bool CheckpointManager::queueDirty(const RCPtr<VBucket> &vb, queued_item& qi,
                 " snapshotStart:" + std::to_string(st) +
                 " lastBySeqno:" + std::to_string(lastBySeqno) +
                 " snapshotEnd:" + std::to_string(en) +
-                " genSeqno:" + (genSeqno ? "True" : "False"));
+                " genSeqno:" + to_string(generateBySeqno));
     }
 
     queue_dirty_t result = checkpointList.back()->queueDirty(qi, this);
index 1b1f78a..f45a175 100644 (file)
@@ -28,6 +28,7 @@
 #include <vector>
 
 #include "atomic.h"
+#include "ep_types.h"
 #include "item.h"
 #include "locks.h"
 #include "stats.h"
@@ -541,12 +542,14 @@ public:
 
     /**
      * Queue an item to be written to persistent layer.
-     * @param item the item to be persisted.
      * @param vbucket the vbucket that a new item is pushed into.
-     * @param bySeqno the sequence number assigned to this mutation
+     * @param qi item to be persisted.
+     * @param generateBySeqno yes/no generate the seqno for the item
      * @return true if an item queued increases the size of persistence queue by 1.
      */
-    bool queueDirty(const RCPtr<VBucket> &vb, queued_item& qi, bool genSeqno);
+    bool queueDirty(const RCPtr<VBucket> &vb,
+                    queued_item& qi,
+                    const GenerateBySeqno generateBySeqno);
 
     /**
      * Return the next item to be sent to a given connection
index 56ac1ac..821f642 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -620,7 +620,7 @@ EventuallyPersistentStore::deleteExpiredItem(uint16_t vbid, std::string &key,
                 } else if (v->isExpired(startTime) && !v->isDeleted()) {
                     vb->ht.unlocked_softDelete(v, 0, getItemEvictionPolicy());
                     v->setCas(vb->nextHLCCas());
-                    queueDirty(vb, v, &lh, NULL, false);
+                    queueDirty(vb, v, &lh, NULL);
                 }
             } else {
                 if (eviction_policy == FULL_EVICTION) {
@@ -638,7 +638,7 @@ EventuallyPersistentStore::deleteExpiredItem(uint16_t vbid, std::string &key,
                         v->setRevSeqno(revSeqno);
                         vb->ht.unlocked_softDelete(v, 0, eviction_policy);
                         v->setCas(vb->nextHLCCas());
-                        queueDirty(vb, v, &lh, NULL, false);
+                        queueDirty(vb, v, &lh, NULL);
                     }
                 }
             }
@@ -678,7 +678,7 @@ StoredValue *EventuallyPersistentStore::fetchValidValue(RCPtr<VBucket> &vb,
                 incExpirationStat(vb, EXP_BY_ACCESS);
                 vb->ht.unlocked_softDelete(v, 0, eviction_policy);
                 v->setCas(vb->nextHLCCas());
-                queueDirty(vb, v, NULL, NULL, false);
+                queueDirty(vb, v, NULL, NULL);
             }
             return wantDeleted ? v : NULL;
         }
@@ -1109,7 +1109,8 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::addTAPBackfillItem(
         // FALLTHROUGH
     case WAS_CLEAN:
         vb->setMaxCas(v->getCas());
-        queueDirty(vb, v, &lh, NULL, true, genBySeqno);
+        tapQueueDirty(vb, v, lh, NULL,
+                      genBySeqno ? GenerateBySeqno::Yes : GenerateBySeqno::No);
         break;
     case INVALID_VBUCKET:
         ret = ENGINE_NOT_MY_VBUCKET;
@@ -2358,7 +2359,8 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::setWithMeta(
     case WAS_DIRTY:
     case WAS_CLEAN:
         vb->setMaxCas(v->getCas());
-        queueDirty(vb, v, &lh, seqno, false, genBySeqno);
+        queueDirty(vb, v, &lh, seqno,
+                   genBySeqno ? GenerateBySeqno::Yes : GenerateBySeqno::No);
         break;
     case NOT_FOUND:
         ret = ENGINE_KEY_ENOENT;
@@ -2879,12 +2881,12 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::deleteItem(const std::string &key,
     case NOT_FOUND:
         ret = ENGINE_KEY_ENOENT;
         if (v) {
-            queueDirty(vb, v, &lh, NULL, /*tapBackfill*/false);
+            queueDirty(vb, v, &lh, NULL);
         }
         break;
     case WAS_DIRTY:
     case WAS_CLEAN:
-        queueDirty(vb, v, &lh, &seqno, /*tapBackfill*/false);
+        queueDirty(vb, v, &lh, &seqno);
         mutInfo->seqno = seqno;
         mutInfo->vbucket_uuid = vb->failovers->getLatestUUID();
         break;
@@ -3024,7 +3026,14 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::deleteWithMeta(
         }
 
         vb->setMaxCas(v->getCas());
-        queueDirty(vb, v, &lh, seqno, tapBackfill, genBySeqno);
+
+        if (tapBackfill) {
+            tapQueueDirty(vb, v, lh, seqno,
+                          genBySeqno ? GenerateBySeqno::Yes : GenerateBySeqno::No);
+        } else {
+            queueDirty(vb, v, &lh, seqno,
+                       genBySeqno ? GenerateBySeqno::Yes : GenerateBySeqno::No);
+        }
         break;
     case NEED_BG_FETCH:
         lh.unlock();
@@ -3506,21 +3515,50 @@ void EventuallyPersistentStore::queueDirty(RCPtr<VBucket> &vb,
                                            StoredValue* v,
                                            LockHolder *plh,
                                            uint64_t *seqno,
-                                           bool tapBackfill,
-                                           bool genBySeqno) {
+                                           const GenerateBySeqno generateBySeqno) {
     if (vb) {
         queued_item qi(v->toItem(false, vb->getId()));
 
-        bool rv = tapBackfill ? vb->queueBackfillItem(qi, genBySeqno) :
-                                vb->checkpointManager.queueDirty(vb, qi,
-                                                                 genBySeqno);
+        bool rv = vb->checkpointManager.queueDirty(vb, qi, generateBySeqno);
+        v->setBySeqno(qi->getBySeqno());
+
+        if (seqno) {
+            *seqno = v->getBySeqno();
+        }
+
+        if (plh) {
+            plh->unlock();
+        }
+
+        if (rv) {
+            KVShard* shard = vbMap.getShardByVbId(vb->getId());
+            shard->getFlusher()->notifyFlushEvent();
+        }
+
+        // Now notify replication
+        engine.getTapConnMap().notifyVBConnections(vb->getId());
+        engine.getDcpConnMap().notifyVBConnections(vb->getId(),
+                                                   qi->getBySeqno());
+    }
+}
+
+void EventuallyPersistentStore::tapQueueDirty(RCPtr<VBucket> &vb,
+                                              StoredValue* v,
+                                              LockHolder& plh,
+                                              uint64_t *seqno,
+                                              const GenerateBySeqno generateBySeqno) {
+    if (vb) {
+        queued_item qi(v->toItem(false, vb->getId()));
+
+        bool queued = vb->queueBackfillItem(qi, generateBySeqno);
+
         v->setBySeqno(qi->getBySeqno());
 
         /* During backfill on a TAP receiver we need to update the snapshot
            range in the checkpoint. Has to be done here because in case of TAP
            backfill, above, we use vb->queueBackfillItem() instead of
            vb->checkpointManager.queueDirty() */
-        if (tapBackfill && genBySeqno) {
+        if (GenerateBySeqno::Yes == generateBySeqno) {
             vb->checkpointManager.resetSnapshotRange();
         }
 
@@ -3528,19 +3566,11 @@ void EventuallyPersistentStore::queueDirty(RCPtr<VBucket> &vb,
             *seqno = v->getBySeqno();
         }
 
-        if (plh) {
-            plh->unlock();
-        }
+        plh.unlock();
 
-        if (rv) {
+        if (queued) {
             KVShard* shard = vbMap.getShardByVbId(vb->getId());
             shard->getFlusher()->notifyFlushEvent();
-
-        }
-        if (!tapBackfill) {
-            engine.getTapConnMap().notifyVBConnections(vb->getId());
-            engine.getDcpConnMap().notifyVBConnections(vb->getId(),
-                                                       qi->getBySeqno());
         }
     }
 }
index e514068..43bde3d 100644 (file)
--- a/src/ep.h
+++ b/src/ep.h
@@ -20,6 +20,7 @@
 
 #include "config.h"
 
+#include "ep_types.h"
 #include "executorpool.h"
 #include "stored-value.h"
 #include "task_type.h"
@@ -919,15 +920,31 @@ protected:
      * @param plh the pointer to the hash table partition lock for the dirty item
      *        Note that the lock is released inside this function
      * @param seqno sequence number of the mutation
-     * @param tapBackfill if the item is from backfill replication
-     * @param genBySeqno whether or not to generate sequence number
+     * @param generateBySeqno request that the seqno is generated by this call
      */
     void queueDirty(RCPtr<VBucket> &vb,
                     StoredValue* v,
                     LockHolder *plh,
                     uint64_t *seqno,
-                    bool tapBackfill = false,
-                    bool genBySeqno = true);
+                    const GenerateBySeqno generateBySeqno = GenerateBySeqno::Yes);
+
+    /* Queue an item for persistence following a TAP command
+     *
+     * The caller of this function must hold the lock of the hash table
+     * partition that contains the StoredValue being Queued.
+     *
+     * @param vb the vbucket that contains the dirty item
+     * @param v the dirty item
+     * @param plh the pointer to the hash table partition lock for the dirty item
+     *        Note that the lock is released inside this function
+     * @param seqno sequence number of the mutation
+     * @param generateBySeqno request that the seqno is generated by this call
+     */
+    void tapQueueDirty(RCPtr<VBucket> &vb,
+                       StoredValue* v,
+                       LockHolder& plh,
+                       uint64_t *seqno,
+                       const GenerateBySeqno generateBySeqno);
 
     /**
      * Retrieve a StoredValue and invoke a method on it.
diff --git a/src/ep_types.h b/src/ep_types.h
new file mode 100644 (file)
index 0000000..dd87a87
--- /dev/null
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+ *     Copyright 2016 Couchbase, Inc
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+#pragma once
+#include <stdexcept>
+#include <string>
+#include <type_traits>
+
+enum class GenerateBySeqno {
+    No, Yes
+};
+
+typedef std::underlying_type<GenerateBySeqno>::type GenerateBySeqnoUType;
+
+static inline std::string to_string(const GenerateBySeqno generateBySeqno) {
+    switch (generateBySeqno) {
+        case GenerateBySeqno::Yes:
+            return "Yes";
+        case GenerateBySeqno::No:
+            return "No";
+        default:
+            throw std::invalid_argument("to_string(GenerateBySeqno) unknown " +
+                    std::to_string(static_cast<GenerateBySeqnoUType>(generateBySeqno)));
+            return "";
+    }
+}
index 1f1c75d..2389161 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "bloomfilter.h"
 #include "checkpoint.h"
+#include "ep_types.h"
 #include "failover-table.h"
 #include "kvstore.h"
 #include "stored-value.h"
@@ -303,9 +304,10 @@ public:
         LockHolder lh(backfill.mutex);
         return backfill.items.size();
     }
-    bool queueBackfillItem(queued_item& qi, bool genSeqno) {
+    bool queueBackfillItem(queued_item& qi,
+                           const GenerateBySeqno generateBySeqno) {
         LockHolder lh(backfill.mutex);
-        if (genSeqno) {
+        if (GenerateBySeqno::Yes == generateBySeqno) {
             qi->setBySeqno(checkpointManager.nextBySeqno());
         } else {
             checkpointManager.setBySeqno(qi->getBySeqno());
index c797d45..fa7f69b 100644 (file)
@@ -183,7 +183,7 @@ static void launch_set_thread(void *arg) {
         key << "key-" << i;
         queued_item qi(new Item(key.str(), args->vbucket->getId(),
                                 queue_op_set, 0, 0));
-        args->checkpoint_manager->queueDirty(args->vbucket, qi, true);
+        args->checkpoint_manager->queueDirty(args->vbucket, qi, GenerateBySeqno::Yes);
     }
 }
 }
@@ -264,7 +264,7 @@ TEST_F(CheckpointTest, basic_chk_test) {
     // Push the flush command into the queue so that all other threads can be terminated.
     std::string key("flush");
     queued_item qi(new Item(key, vbucket->getId(), queue_op_flush, 0xffff, 0));
-    checkpoint_manager->queueDirty(vbucket, qi, true);
+    checkpoint_manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes);
 
     rc = cb_join_thread(persistence_thread);
     EXPECT_EQ(0, rc);
@@ -300,7 +300,7 @@ TEST_F(CheckpointTest, reset_checkpoint_id) {
         key << "key-" << i;
         queued_item qi(new Item(key.str(), vbucket->getId(), queue_op_set,
                                 0, 0));
-        manager->queueDirty(vbucket, qi, true);
+        manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes);
     }
     manager->createNewCheckpoint();
 
@@ -359,7 +359,7 @@ TEST_F(CheckpointTest, OneOpenCkpt) {
 
     // No set_ops in queue, expect queueDirty to return true (increase
     // persistence queue size).
-    EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+    EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     EXPECT_EQ(1, manager->getNumCheckpoints());  // Single open checkpoint.
     EXPECT_EQ(2, manager->getNumOpenChkItems()); // 1x op_checkpoint_start, 1x op_set
     EXPECT_EQ(1001, qi->getBySeqno());
@@ -369,7 +369,7 @@ TEST_F(CheckpointTest, OneOpenCkpt) {
     // Adding the same key again shouldn't increase the size.
     queued_item qi2(new Item("key1", vbucket->getId(), queue_op_set,
                             /*revSeq*/21, /*bySeq*/0));
-    EXPECT_FALSE(manager->queueDirty(vbucket, qi2, true));
+    EXPECT_FALSE(manager->queueDirty(vbucket, qi2, GenerateBySeqno::Yes));
     EXPECT_EQ(1, manager->getNumCheckpoints());
     EXPECT_EQ(2, manager->getNumOpenChkItems());
     EXPECT_EQ(1002, qi2->getBySeqno());
@@ -379,7 +379,7 @@ TEST_F(CheckpointTest, OneOpenCkpt) {
     // Adding a different key should increase size.
     queued_item qi3(new Item("key2", vbucket->getId(), queue_op_set,
                             /*revSeq*/0, /*bySeq*/0));
-    EXPECT_TRUE(manager->queueDirty(vbucket, qi3, true));
+    EXPECT_TRUE(manager->queueDirty(vbucket, qi3, GenerateBySeqno::Yes));
     EXPECT_EQ(1, manager->getNumCheckpoints());
     EXPECT_EQ(3, manager->getNumOpenChkItems());
     EXPECT_EQ(1003, qi3->getBySeqno());
@@ -394,7 +394,7 @@ TEST_F(CheckpointTest, OneOpenOneClosed) {
     for (auto i : {1,2}) {
         queued_item qi(new Item("key" + std::to_string(i), vbucket->getId(),
                                 queue_op_set, /*revSeq*/0, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     }
     EXPECT_EQ(1, manager->getNumCheckpoints());
     EXPECT_EQ(3, manager->getNumOpenChkItems()); // 1x op_checkpoint_start, 2x op_set
@@ -412,7 +412,7 @@ TEST_F(CheckpointTest, OneOpenOneClosed) {
     for (auto ii : {1,2}) {
         queued_item qi(new Item("key" + std::to_string(ii), vbucket->getId(),
                                 queue_op_set, /*revSeq*/1, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     }
     EXPECT_EQ(2, manager->getNumCheckpoints());
     EXPECT_EQ(3, manager->getNumOpenChkItems()); // 1x op_checkpoint_start, 2x op_set
@@ -448,7 +448,7 @@ TEST_F(CheckpointTest, ItemBasedCheckpointCreation) {
 
         qi.reset(new Item("key" + std::to_string(ii), vbucket->getId(),
                           queue_op_set, /*revSeq*/0, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
         EXPECT_EQ(1, manager->getNumCheckpoints());
 
     }
@@ -456,7 +456,7 @@ TEST_F(CheckpointTest, ItemBasedCheckpointCreation) {
     // Add one more - should create a new checkpoint.
     qi.reset(new Item("key_epoch", vbucket->getId(), queue_op_set, /*revSeq*/0,
                       /*bySeq*/0));
-    EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+    EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     EXPECT_EQ(2, manager->getNumCheckpoints());
     EXPECT_EQ(2, manager->getNumOpenChkItems()); // 1x op_ckpt_start, 1x op_set
 
@@ -466,7 +466,7 @@ TEST_F(CheckpointTest, ItemBasedCheckpointCreation) {
 
         qi.reset(new Item("key" + std::to_string(ii), vbucket->getId(),
                                 queue_op_set, /*revSeq*/1, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
         EXPECT_EQ(2, manager->getNumCheckpoints());
     }
 
@@ -474,7 +474,7 @@ TEST_F(CheckpointTest, ItemBasedCheckpointCreation) {
     // new one.
     qi.reset(new Item("key_epoch2", vbucket->getId(), queue_op_set,
                       /*revSeq*/1, /*bySeq*/0));
-    EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+    EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     EXPECT_EQ(2, manager->getNumCheckpoints());
     EXPECT_EQ(12, // 1x op_ckpt_start, 1x key_epoch, 9x key_X, 1x key_epoch2
               manager->getNumOpenChkItems());
@@ -494,7 +494,7 @@ TEST_F(CheckpointTest, ItemBasedCheckpointCreation) {
     // But adding a new item will create a new one.
     qi.reset(new Item("key_epoch3", vbucket->getId(), queue_op_set,
                       /*revSeq*/1, /*bySeq*/0));
-    EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+    EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     EXPECT_EQ(3, manager->getNumCheckpoints());
     EXPECT_EQ(2, manager->getNumOpenChkItems()); // 1x op_ckpt_start, 1x op_set
 }
@@ -507,7 +507,7 @@ TEST_F(CheckpointTest, CursorOffsetOnCheckpointClose) {
     for (auto i : {1,2}) {
         queued_item qi(new Item("key" + std::to_string(i), vbucket->getId(),
                                 queue_op_set, /*revSeq*/0, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     }
     EXPECT_EQ(1, manager->getNumCheckpoints());
     EXPECT_EQ(3, manager->getNumOpenChkItems()); // 1x op_checkpoint_start, 2x op_set
@@ -521,7 +521,7 @@ TEST_F(CheckpointTest, CursorOffsetOnCheckpointClose) {
     // should still see two items.
     queued_item qi(new Item("key1", vbucket->getId(),
                             queue_op_set, /*revSeq*/0, /*bySeq*/0));
-    EXPECT_FALSE(manager->queueDirty(vbucket, qi, true))
+    EXPECT_FALSE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes))
         << "Adding a duplicate key to open checkpoint should not increase queue size";
 
     EXPECT_EQ(2, manager->getNumItemsForCursor(CheckpointManager::pCursorName))
@@ -551,7 +551,7 @@ TEST_F(CheckpointTest, CursorOffsetOnCheckpointClose) {
     for (auto ii : {1,2}) {
         queued_item qi(new Item("key" + std::to_string(ii), vbucket->getId(),
                                 queue_op_set, /*revSeq*/1, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     }
 
     EXPECT_EQ(3, manager->getNumItemsForCursor(CheckpointManager::pCursorName))
@@ -618,7 +618,7 @@ TEST_F(CheckpointTest, ItemsForCheckpointCursor) {
     for (unsigned int ii = 0; ii < 2 * MIN_CHECKPOINT_ITEMS; ii++) {
         qi.reset(new Item("key" + std::to_string(ii), vbucket->getId(),
                           queue_op_set, /*revSeq*/0, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     }
 
     /* Check if we have desired number of checkpoints and desired number of
@@ -669,7 +669,7 @@ TEST_F(CheckpointTest, CursorMovement) {
     for (unsigned int ii = 0; ii < MIN_CHECKPOINT_ITEMS; ii++) {
         qi.reset(new Item("key" + std::to_string(ii), vbucket->getId(),
                           queue_op_set, /*revSeq*/0, /*bySeq*/0));
-        EXPECT_TRUE(manager->queueDirty(vbucket, qi, true));
+        EXPECT_TRUE(manager->queueDirty(vbucket, qi, GenerateBySeqno::Yes));
     }
 
     /* Check if we have desired number of checkpoints and desired number of