[rhmessaging-commits] rhmessaging commits: r3525 - in store/trunk/cpp/lib: jrnl and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Jul 29 13:18:34 EDT 2009


Author: kpvdr
Date: 2009-07-29 13:18:34 -0400 (Wed, 29 Jul 2009)
New Revision: 3525

Modified:
   store/trunk/cpp/lib/MessageStoreImpl.cpp
   store/trunk/cpp/lib/MessageStoreImpl.h
   store/trunk/cpp/lib/jrnl/jcntl.cpp
   store/trunk/cpp/lib/jrnl/jerrno.cpp
   store/trunk/cpp/lib/jrnl/lpmgr.cpp
Log:
Fix for BZ514568 - "[store] JERR_LFMGR_BADAEFNUMLIM thrown when using python tools to create queue containing 16 or more journal files". Made auto-expand default to off (which prevents parameter checking); also corrected some of the check logic and improved the error messages.

Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp	2009-07-29 11:48:45 UTC (rev 3524)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp	2009-07-29 17:18:34 UTC (rev 3525)
@@ -193,14 +193,20 @@
                 << JRNL_MAX_NUM_FILES << "); changing this parameter to maximum value.");
         return;
     }
-    if (p <= numJrnlFiles) {
-        // auto-expand-max-jfiles less than num-jfiles, adjust to num-jfiles + 2 (or num-jfiles + 1 if jfiles is only one less than max allowable)
-        u_int16_t incr = JRNL_MAX_NUM_FILES - numJrnlFiles > 1 ? 2 : 1;
+    u_int16_t q = opts->autoJrnlExpandMaxFiles;
+    if (q && q == defAutoJrnlExpandMaxFiles && numJrnlFiles != defTplNumJrnlFiles) {
+        // num-jfiles is different from the default AND max-auto-expand-jfiles is still at default
+        // change value of max-auto-expand-jfiles
         autoJrnlExpand = true;
-        autoJrnlExpandMaxFiles = numJrnlFiles + incr;
-        QPID_LOG(warning, "parameter " << autoJrnlExpandMaxFilesParamName << " (" << p << ") is not above that of parameter "
-                << numJrnlFilesParamName << " (" << numJrnlFiles << "); changing this parameter to value of parameter " << numJrnlFilesParamName
-                << " plus " << incr << " (" << autoJrnlExpandMaxFiles << ").");
+        if (2 * numJrnlFiles <= JRNL_MAX_NUM_FILES) {
+            autoJrnlExpandMaxFiles = 2 * numJrnlFiles <= JRNL_MAX_NUM_FILES ? 2 * numJrnlFiles : JRNL_MAX_NUM_FILES;
+            QPID_LOG(warning, "parameter " << autoJrnlExpandMaxFilesParamName << " adjusted from its default value ("
+                    << defAutoJrnlExpandMaxFiles << ") to twice that of parameter " << numJrnlFilesParamName << " (" << autoJrnlExpandMaxFiles << ").");
+        } else {
+            autoJrnlExpandMaxFiles = 2 * numJrnlFiles <= JRNL_MAX_NUM_FILES ? 2 * numJrnlFiles : JRNL_MAX_NUM_FILES;
+            QPID_LOG(warning, "parameter " << autoJrnlExpandMaxFilesParamName << " adjusted from its default to maximum allowable value ("
+                    << JRNL_MAX_NUM_FILES << ") because of the value of " << numJrnlFilesParamName << " (" << numJrnlFiles << ").");
+        }
         return;
     }
     // No adjustments req'd, set values

Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h	2009-07-29 11:48:45 UTC (rev 3524)
+++ store/trunk/cpp/lib/MessageStoreImpl.h	2009-07-29 17:18:34 UTC (rev 3525)
@@ -103,8 +103,9 @@
     static const u_int16_t defTplNumJrnlFiles = 8;
     static const u_int32_t defTplJrnlFileSizePgs = 24;
     static const u_int32_t defTplWCachePageSize = defWCachePageSize / 8;
-    static const bool      defAutoJrnlExpand = true;
-    static const u_int16_t defAutoJrnlExpandMaxFiles = 16;
+    // TODO: set defAutoJrnlExpand to true and defAutoJrnlExpandMaxFiles to 16 when auto-expand comes on-line
+    static const bool      defAutoJrnlExpand = false;
+    static const u_int16_t defAutoJrnlExpandMaxFiles = 0;
 
     std::list<db_ptr> dbs;
     dbEnv_ptr dbenv;

Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp	2009-07-29 11:48:45 UTC (rev 3524)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp	2009-07-29 17:18:34 UTC (rev 3525)
@@ -89,7 +89,7 @@
 }
 
 void
-jcntl::initialize(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
+jcntl::initialize(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
         const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
         aio_callback* const cbp)
 {
@@ -114,7 +114,7 @@
 
     // Clear any existing journal files
     _jdir.clear_dir();
-    _lpmgr.initialize(num_jfiles, auto_expand, ae_max_jfiles, this, &new_fcntl);
+    _lpmgr.initialize(num_jfiles, ae, ae_max_jfiles, this, &new_fcntl);
 
     _wrfc.initialize(_jfsize_sblks);
     _rrfc.initialize();
@@ -129,7 +129,7 @@
 }
 
 void
-jcntl::recover(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
+jcntl::recover(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
         const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
 //         const rd_aio_cb rd_cb, const wr_aio_cb wr_cb, const std::vector<std::string>* prep_txn_list_ptr,
         aio_callback* const cbp, const std::vector<std::string>* prep_txn_list_ptr,
@@ -152,7 +152,7 @@
 
     // Verify journal dir and journal files
     _jdir.verify_dir();
-    _rcvdat.reset(num_jfiles, auto_expand, ae_max_jfiles);
+    _rcvdat.reset(num_jfiles, ae, ae_max_jfiles);
 
     rcvr_janalyze(_rcvdat, prep_txn_list_ptr);
     highest_rid = _rcvdat._h_rid;

Modified: store/trunk/cpp/lib/jrnl/jerrno.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.cpp	2009-07-29 11:48:45 UTC (rev 3524)
+++ store/trunk/cpp/lib/jrnl/jerrno.cpp	2009-07-29 17:18:34 UTC (rev 3525)
@@ -176,7 +176,7 @@
     _err_map[JERR_FCNTL_RDOFFSOVFL] = "JERR_FCNTL_RDOFFSOVFL: Attempted increase read offset past write offset.";
 
     // class lfmgr
-    _err_map[JERR_LFMGR_BADAEFNUMLIM] = "JERR_LFMGR_BADAEFNUMLIM: Bad auto-expand file number limit.";
+    _err_map[JERR_LFMGR_BADAEFNUMLIM] = "JERR_LFMGR_BADAEFNUMLIM: Auto-expand file number limit lower than initial number of journal files.";
     _err_map[JERR_LFMGR_AEFNUMLIMIT] = "JERR_LFMGR_AEFNUMLIMIT: Exceeded auto-expand file number limit.";
     _err_map[JERR_LFMGR_AEDISABLED] = "JERR_LFMGR_AEDISABLED: Attempted to expand with auto-expand disabled.";
 

Modified: store/trunk/cpp/lib/jrnl/lpmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/lpmgr.cpp	2009-07-29 11:48:45 UTC (rev 3524)
+++ store/trunk/cpp/lib/jrnl/lpmgr.cpp	2009-07-29 17:18:34 UTC (rev 3525)
@@ -64,7 +64,7 @@
     if (ae && ae_max_jfiles > 0 && ae_max_jfiles <= num_jfiles)
     {
         std::ostringstream oss;
-        oss << "_ae_max_jfiles=" << ae_max_jfiles << "; num_jfiles=" << num_jfiles;
+        oss << "ae_max_jfiles (" << ae_max_jfiles << ") <= num_jfiles (" << num_jfiles << ")";
         throw jexception(jerrno::JERR_LFMGR_BADAEFNUMLIM,  oss.str(), "lpmgr", "initialize");
     }
     _ae = ae;
@@ -89,7 +89,7 @@
     if (rd._aemjf > 0 && rd._aemjf <= rd._njf)
     {
         std::ostringstream oss;
-        oss << "_ae_max_jfiles=" << rd._aemjf << "; num_jfiles=" <<rd._njf ;
+        oss << "ae_max_jfiles (" << rd._aemjf << ") <= num_jfiles (" << rd._njf << ")";
         throw jexception(jerrno::JERR_LFMGR_BADAEFNUMLIM,  oss.str(), "lpmgr", "recover");
     }
     _ae = rd._ae;
@@ -155,7 +155,7 @@
     if (ae && _ae_max_jfiles > 0 && _ae_max_jfiles <= _fcntl_arr.size())
     {
         std::ostringstream oss;
-        oss << "_ae_max_jfiles=" << _ae_max_jfiles << "; _fcntl_arr.size()=" << _fcntl_arr.size();
+        oss << "ae_max_jfiles (" << _ae_max_jfiles << ") <= _fcntl_arr.size (" << _fcntl_arr.size() << ")";
         throw jexception(jerrno::JERR_LFMGR_BADAEFNUMLIM, oss.str(), "lpmgr", "set_ae");
     }
     if (ae && _fcntl_arr.max_size() < _ae_max_jfiles)
@@ -169,7 +169,7 @@
     if (_ae && ae_max_jfiles > 0 && ae_max_jfiles <= _fcntl_arr.size())
     {
         std::ostringstream oss;
-        oss << "_ae_max_jfiles=" << _ae_max_jfiles << "; _fcntl_arr.size()=" << _fcntl_arr.size();
+        oss << "ae_max_jfiles (" << _ae_max_jfiles << ") <= _fcntl_arr.size() (" << _fcntl_arr.size() << ")";
         throw jexception(jerrno::JERR_LFMGR_BADAEFNUMLIM,  oss.str(), "lpmgr", "set_ae_max_jfiles");
     }
     if (_ae && _fcntl_arr.max_size() < ae_max_jfiles)



More information about the rhmessaging-commits mailing list