Remove default parameter from queueDirty 23/67623/12
authorDaniel Owen <owend@couchbase.com>
Tue, 13 Sep 2016 11:14:32 +0000 (12:14 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 28 Sep 2016 14:32:43 +0000 (14:32 +0000)
The EventuallyPersistentStore method queueDirty has a parameter called
notifyReplicator, which is defaulted to true.  The parameter is used
to specify whether or not to notify the replicator.

However the queueDirty method either uses the notifyReplicator default
of true, or is passed in true.

This patch removes the unrequired parameter from the queueDirty
definition and simpifies the body of the method.

Change-Id: I6340e522f0e6137bc744450ddc90e418ed7716a2
Reviewed-on: http://review.couchbase.org/67623
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Reviewed-by: Sriram Ganesan <sriram@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/ep.cc
src/ep.h

index 31e1c9d..e65ecff 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -684,7 +684,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, true);
+                queueDirty(vb, v, NULL, NULL, false);
             }
             return wantDeleted ? v : NULL;
         }
@@ -1123,7 +1123,7 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::addTAPBackfillItem(
                                       emd->getConflictResMode()));
         }
         vb->setMaxCas(v->getCas());
-        queueDirty(vb, v, &lh, NULL,true, true, genBySeqno, false);
+        queueDirty(vb, v, &lh, NULL, true, genBySeqno, false);
         break;
     case INVALID_VBUCKET:
         ret = ENGINE_NOT_MY_VBUCKET;
@@ -2396,7 +2396,7 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::setWithMeta(
                                             emd->getConflictResMode()));
         }
         vb->setMaxCas(v->getCas());
-        queueDirty(vb, v, &lh, seqno, false, true, genBySeqno, false);
+        queueDirty(vb, v, &lh, seqno, false, genBySeqno, false);
         break;
     case NOT_FOUND:
         ret = ENGINE_KEY_ENOENT;
@@ -3081,7 +3081,7 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::deleteWithMeta(
                                          emd->getConflictResMode()));
         }
         vb->setMaxCas(v->getCas());
-        queueDirty(vb, v, &lh, seqno, tapBackfill, true, genBySeqno, false);
+        queueDirty(vb, v, &lh, seqno, tapBackfill, genBySeqno, false);
         break;
     case NEED_BG_FETCH:
         lh.unlock();
@@ -3568,7 +3568,6 @@ void EventuallyPersistentStore::queueDirty(RCPtr<VBucket> &vb,
                                            LockHolder *plh,
                                            uint64_t *seqno,
                                            bool tapBackfill,
-                                           bool notifyReplicator,
                                            bool genBySeqno,
                                            bool setConflictMode) {
     if (vb) {
@@ -3614,7 +3613,7 @@ void EventuallyPersistentStore::queueDirty(RCPtr<VBucket> &vb,
             shard->getFlusher()->notifyFlushEvent();
 
         }
-        if (!tapBackfill && notifyReplicator) {
+        if (!tapBackfill) {
             engine.getTapConnMap().notifyVBConnections(vb->getId());
             engine.getDcpConnMap().notifyVBConnections(vb->getId(),
                                                        qi->getBySeqno());
index 8418a4f..4ac2091 100644 (file)
--- a/src/ep.h
+++ b/src/ep.h
@@ -920,7 +920,6 @@ protected:
      *        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 notifyReplicator whether or not to notify the replicator
      * @param genBySeqno whether or not to generate sequence number
      * @param setConflictMode set the conflict resolution mode
      */
@@ -929,7 +928,6 @@ protected:
                     LockHolder *plh,
                     uint64_t *seqno,
                     bool tapBackfill = false,
-                    bool notifyReplicator = true,
                     bool genBySeqno = true,
                     bool setConflictMode = true);