You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2017/02/09 18:42:00 UTC

qpid-cpp git commit: QPID-7666: Fixed minor inconsistency with journal-flush-timeout parameter not being scaled from ms to ns correctly

Repository: qpid-cpp
Updated Branches:
  refs/heads/master 34cfb7f0a -> 13f0fe591


QPID-7666: Fixed minor inconsistency with journal-flush-timeout parameter not being scaled from ms to ns correctly


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/13f0fe59
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/13f0fe59
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/13f0fe59

Branch: refs/heads/master
Commit: 13f0fe591a5ac025f98bb45f7084462ab2788f6e
Parents: 34cfb7f
Author: Kim van der Riet <kp...@apache.org>
Authored: Thu Feb 9 13:41:45 2017 -0500
Committer: Kim van der Riet <kp...@apache.org>
Committed: Thu Feb 9 13:41:45 2017 -0500

----------------------------------------------------------------------
 src/qpid/linearstore/MessageStoreImpl.cpp | 20 +++++++++-----------
 src/qpid/linearstore/MessageStoreImpl.h   |  6 +++---
 2 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/13f0fe59/src/qpid/linearstore/MessageStoreImpl.cpp
----------------------------------------------------------------------
diff --git a/src/qpid/linearstore/MessageStoreImpl.cpp b/src/qpid/linearstore/MessageStoreImpl.cpp
index e3a8b4c..f84defc 100644
--- a/src/qpid/linearstore/MessageStoreImpl.cpp
+++ b/src/qpid/linearstore/MessageStoreImpl.cpp
@@ -58,7 +58,7 @@ MessageStoreImpl::MessageStoreImpl(qpid::broker::Broker* broker_, const char* en
                                    tplWCachePgSizeSblks(0),
                                    tplWCacheNumPages(0),
                                    highestRid(0),
-                                   journalFlushTimeout(defJournalFlushTimeoutNs),
+                                   journalFlushTimeoutNs(0),
                                    isInit(false),
                                    envPath(envpath_),
                                    broker(broker_),
@@ -156,7 +156,7 @@ bool MessageStoreImpl::init(const qpid::Options* options_)
     uint16_t jrnlWrCacheNumPages = chkJrnlWrCacheNumPages(opts->wCacheNumPages, "wcache-num-pages");
     uint32_t tplJrnlWrCachePageSizeKib = chkJrnlWrPageCacheSize(opts->tplWCachePageSizeKib, "tpl-wcache-page-size");
     uint16_t tplJrnlWrCacheNumPages = chkJrnlWrCacheNumPages(opts->tplWCacheNumPages, "tpl-wcache-num-pages");
-    journalFlushTimeout = opts->journalFlushTimeout;
+    journalFlushTimeoutNs = opts->journalFlushTimeoutMs * 1000000;
 
     // Pass option values to init()
     return init(opts->storeDir,
@@ -204,10 +204,8 @@ bool MessageStoreImpl::init(const std::string& storeDir_,
     QLS_LOG(info,   "> Default number of write cache pages: " << wCacheNumPages);
     QLS_LOG(info,   "> TPL write cache page size: " << tplWCachePageSizeKib_ << " (KiB)");
     QLS_LOG(info,   "> TPL number of write cache pages: " << tplWCacheNumPages);
-    QLS_LOG(info,   "> EFP partition: " << defaultEfpPartitionNumber);
-    QLS_LOG(info,   "> EFP file size pool: " << defaultEfpFileSize_kib << " (KiB)");
     QLS_LOG(info,   "> Overwrite before return to EFP: " << (overwriteBeforeReturnFlag?"True":"False"));
-    QLS_LOG(info,   "> Maximum journal flush time: " << journalFlushTimeout);
+    QLS_LOG(info,   "> Maximum journal flush time: " << (journalFlushTimeoutNs/1000000) << "ms");
 
     return isInit;
 }
@@ -262,7 +260,7 @@ void MessageStoreImpl::init(const bool truncateFlag)
             // NOTE: during normal initialization, agent == 0 because the store is initialized before the management infrastructure.
             // However during a truncated initialization in a cluster, agent != 0. We always pass 0 as the agent for the
             // TplStore to keep things consistent in a cluster. See https://bugzilla.redhat.com/show_bug.cgi?id=681026
-            tplStorePtr.reset(new TplJournalImpl(broker->getTimer(), "TplStore", getTplBaseDir(), jrnlLog, defJournalGetEventsTimeoutNs, journalFlushTimeout, 0));
+            tplStorePtr.reset(new TplJournalImpl(broker->getTimer(), "TplStore", getTplBaseDir(), jrnlLog, defJournalGetEventsTimeoutNs, journalFlushTimeoutNs, 0));
             isInit = true;
         } catch (const DbException& e) {
             if (e.get_errno() == DB_VERSION_MISMATCH)
@@ -423,7 +421,7 @@ void MessageStoreImpl::create(qpid::broker::PersistableQueue& queue_,
     }
 
     jQueue = new JournalImpl(broker->getTimer(), queue_.getName(), getJrnlDir(queue_.getName()), jrnlLog,
-                             defJournalGetEventsTimeoutNs, journalFlushTimeout, agent,
+                             defJournalGetEventsTimeoutNs, journalFlushTimeoutNs, agent,
                              boost::bind(&MessageStoreImpl::journalDeleted, this, _1));
     {
         qpid::sys::Mutex::ScopedLock sl(journalListLock);
@@ -742,7 +740,7 @@ void MessageStoreImpl::recoverQueues(TxnCtxt& txn,
             break;
         }
         jQueue = new JournalImpl(broker->getTimer(), queueName, getJrnlDir(queueName),jrnlLog,
-                                 defJournalGetEventsTimeoutNs, journalFlushTimeout, agent,
+                                 defJournalGetEventsTimeoutNs, journalFlushTimeoutNs, agent,
                                  boost::bind(&MessageStoreImpl::journalDeleted, this, _1));
         {
             qpid::sys::Mutex::ScopedLock sl(journalListLock);
@@ -1545,7 +1543,7 @@ MessageStoreImpl::StoreOptions::StoreOptions(const std::string& name_) :
                                              efpPartition(defEfpPartition),
                                              efpFileSizeKib(defEfpFileSizeKib),
                                              overwriteBeforeReturnFlag(defOverwriteBeforeReturnFlag),
-                                             journalFlushTimeout(defJournalFlushTimeoutNs)
+                                             journalFlushTimeoutMs(defJournalFlushTimeoutMs)
 {
     addOptions()
         ("store-dir", qpid::optValue(storeDir, "DIR"),
@@ -1576,8 +1574,8 @@ MessageStoreImpl::StoreOptions::StoreOptions(const std::string& name_) :
                 "it to the Empty File Pool. When not in use (the default), then old message data remains "
                 "in the file, but is overwritten on next use. This option should only be used where security "
                 "considerations justify it as it makes the store somewhat slower.")
-        ("journal-flush-timeout", qpid::optValue(journalFlushTimeout, "SECONDS"),
-                "Maximum time to wait to flush journal")
+        ("journal-flush-timeout", qpid::optValue(journalFlushTimeoutMs, "MS"),
+                "Maximum time to wait to flush journal in milliseconds")
         ;
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/13f0fe59/src/qpid/linearstore/MessageStoreImpl.h
----------------------------------------------------------------------
diff --git a/src/qpid/linearstore/MessageStoreImpl.h b/src/qpid/linearstore/MessageStoreImpl.h
index 0025100..0d230a7 100644
--- a/src/qpid/linearstore/MessageStoreImpl.h
+++ b/src/qpid/linearstore/MessageStoreImpl.h
@@ -86,7 +86,7 @@ class MessageStoreImpl : public qpid::broker::MessageStore, public qpid::managem
         uint16_t efpPartition;
         uint64_t efpFileSizeKib;
         bool overwriteBeforeReturnFlag;
-        qpid::sys::Duration journalFlushTimeout;
+        uint32_t journalFlushTimeoutMs;
     };
 
   private:
@@ -113,7 +113,7 @@ class MessageStoreImpl : public qpid::broker::MessageStore, public qpid::managem
 
     // FIXME aconway 2010-03-09: was 10ms
     static const uint64_t defJournalGetEventsTimeoutNs =   1 * 1000000; // 1ms
-    static const uint64_t defJournalFlushTimeoutNs     = 500 * 1000000; // 500ms
+    static const uint64_t defJournalFlushTimeoutMs     = 500;
 
     std::list<db_ptr> dbs;
     dbEnv_ptr dbenv;
@@ -144,7 +144,7 @@ class MessageStoreImpl : public qpid::broker::MessageStore, public qpid::managem
     uint32_t tplWCachePgSizeSblks;
     uint16_t tplWCacheNumPages;
     uint64_t highestRid;
-    qpid::sys::Duration journalFlushTimeout;
+    qpid::sys::Duration journalFlushTimeoutNs;
     bool isInit;
     const char* envPath;
     qpid::broker::Broker* broker;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org