MB-17220: [BP] Seperate logs for notifying seqno/checkpoint persistence 33/58233/3
authorabhinavdangeti <abhinav@couchbase.com>
Tue, 1 Dec 2015 19:08:41 +0000 (11:08 -0800)
committerabhinav dangeti <abhinav@couchbase.com>
Tue, 5 Jan 2016 01:06:53 +0000 (01:06 +0000)
- Print different logs while notifying completion or timeouts
during seqno persistence and checkpoint persistence.
- Also adding additional information to the logs.

Change-Id: Idf29cab2197f37b180b0295b19f6b46542bdc6b6
Reviewed-on: http://review.couchbase.org/58233
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/ep.cc
src/vbucket.cc
src/vbucket.h

index b4e4f40..050a396 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -2789,8 +2789,8 @@ int EventuallyPersistentStore::flushVBucket(uint16_t vbid) {
             vb->checkpointManager.itemsPersisted();
             uint64_t seqno = vbMap.getPersistenceSeqno(vbid);
             uint64_t chkid = vb->checkpointManager.getPersistenceCursorPreChkId();
-            vb->notifyCheckpointPersisted(engine, seqno, true);
-            vb->notifyCheckpointPersisted(engine, chkid, false);
+            vb->notifyOnPersistence(engine, seqno, true);
+            vb->notifyOnPersistence(engine, chkid, false);
             if (chkid > 0 && chkid != vbMap.getPersistenceCheckpointId(vbid)) {
                 vbMap.setPersistenceCheckpointId(vbid, chkid);
             }
index 0f7af07..7ee5abe 100644 (file)
@@ -303,13 +303,17 @@ void VBucket::addHighPriorityVBEntry(uint64_t id, const void *cookie,
     numHpChks = hpChks.size();
 }
 
-void VBucket::notifyCheckpointPersisted(EventuallyPersistentEngine &e,
-                                        uint64_t idNum,
-                                        bool isBySeqno) {
+void VBucket::notifyOnPersistence(EventuallyPersistentEngine &e,
+                                  uint64_t idNum,
+                                  bool isBySeqno) {
     LockHolder lh(hpChksMutex);
     std::map<const void*, ENGINE_ERROR_CODE> toNotify;
     std::list<HighPriorityVBEntry>::iterator entry = hpChks.begin();
 
+    std::string logStr(isBySeqno
+                       ? "seqno persistence"
+                       : "checkpoint persistence");
+
     while (entry != hpChks.end()) {
         if (isBySeqno != entry->isBySeqno_) {
             ++entry;
@@ -322,9 +326,10 @@ void VBucket::notifyCheckpointPersisted(EventuallyPersistentEngine &e,
             toNotify[entry->cookie] = ENGINE_SUCCESS;
             stats.chkPersistenceHisto.add(wall_time / 1000);
             adjustCheckpointFlushTimeout(wall_time / 1000000000);
-            LOG(EXTENSION_LOG_WARNING, "Notified the completion of checkpoint "
-                "persistence for vbucket %d, id %llu, cookie %p", id, idNum,
-                entry->cookie);
+            LOG(EXTENSION_LOG_WARNING, "Notified the completion of %s "
+                "for vbucket %" PRIu16 ", Check for: %" PRIu64 ", "
+                "Persisted upto: %" PRIu64 ", cookie %p",
+                logStr.c_str(), id, entry->id, idNum, entry->cookie);
             entry = hpChks.erase(entry);
             if (shard) {
                 --shard->highPriorityCount;
@@ -333,9 +338,10 @@ void VBucket::notifyCheckpointPersisted(EventuallyPersistentEngine &e,
             adjustCheckpointFlushTimeout(spent);
             e.storeEngineSpecific(entry->cookie, NULL);
             toNotify[entry->cookie] = ENGINE_TMPFAIL;
-            LOG(EXTENSION_LOG_WARNING, "Notified the timeout on checkpoint "
-                "persistence for vbucket %d, id %llu, cookie %p", id, idNum,
-                entry->cookie);
+            LOG(EXTENSION_LOG_WARNING, "Notified the timeout on %s "
+                "for vbucket %" PRIu16 ", Check for: %" PRIu64 ", "
+                "Persisted upto: %" PRIu64 ", cookie %p",
+                logStr.c_str(), id, entry->id, idNum, entry->cookie);
             entry = hpChks.erase(entry);
             if (shard) {
                 --shard->highPriorityCount;
index 4ac9f10..dda0a2f 100644 (file)
@@ -359,8 +359,10 @@ public:
         }
     }
 
-    void addHighPriorityVBEntry(uint64_t id, const void *cookie, bool isBySeqno);
-    void notifyCheckpointPersisted(EventuallyPersistentEngine &e, uint64_t id, bool isBySeqno);
+    void addHighPriorityVBEntry(uint64_t id, const void *cookie,
+                                bool isBySeqno);
+    void notifyOnPersistence(EventuallyPersistentEngine &e,
+                             uint64_t id, bool isBySeqno);
     void notifyAllPendingConnsFailed(EventuallyPersistentEngine &e);
     size_t getHighPriorityChkSize();
     static size_t getCheckpointFlushTimeout();