rhmessaging commits: r3526 - store/trunk/cpp/tests/jrnl/jtt.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-29 15:22:31 -0400 (Wed, 29 Jul 2009)
New Revision: 3526
Modified:
store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
Log:
Minor improvements to python analysis tool
Modified: store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2009-07-29 17:18:34 UTC (rev 3525)
+++ store/trunk/cpp/tests/jrnl/jtt/jfile_chk.py 2009-07-29 19:22:31 UTC (rev 3526)
@@ -550,7 +550,7 @@
warn = ' (WARNING: dequeue rid 0x%x dequeues locked enqueue record 0x%x)' % (hdr.rid, hdr.deq_rid)
del self.emap[hdr.deq_rid]
else:
- warn = ' (WARNING: rid being dequeued %d not found in enqueued records)' % hdr.deq_rid
+ warn = ' (WARNING: rid being dequeued 0x%x not found in enqueued records)' % hdr.deq_rid
else:
if hdr.deq_rid in self.emap:
t = self.emap[hdr.deq_rid]
@@ -800,13 +800,14 @@
print 'WARNING: Found %d messages; %d expected.' % (self.msg_cnt, self.num_msgs)
if len(self.emap) > 0:
print
- print 'Remaining enqueued records: '
- for h in self.emap:
- if self.emap[h][2] == True: # locked
+ print 'Remaining enqueued records (sorted by rid): '
+ keys = sorted(self.emap.keys())
+ for k in keys:
+ if self.emap[k][2] == True: # locked
locked = ' (locked)'
else:
locked = ''
- print " fid=%d %s%s" % (self.emap[h][0], self.emap[h][1], locked)
+ print " fid=%d %s%s" % (self.emap[k][0], self.emap[k][1], locked)
print 'WARNING: Enqueue-Dequeue mismatch, %d enqueued records remain.' % len(self.emap)
if len(self.tmap) > 0:
txn_rec_cnt = 0
15 years, 5 months
rhmessaging commits: r3525 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
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)
15 years, 5 months
rhmessaging commits: r3524 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-29 07:48:45 -0400 (Wed, 29 Jul 2009)
New Revision: 3524
Modified:
store/trunk/cpp/lib/TxnCtxt.h
store/trunk/cpp/lib/jrnl/lpmgr.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Small refactorization of read manager syncronization code
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2009-07-28 13:01:08 UTC (rev 3523)
+++ store/trunk/cpp/lib/TxnCtxt.h 2009-07-29 11:48:45 UTC (rev 3524)
@@ -79,7 +79,7 @@
/**
* Call to make sure all the data for this txn is written to safe store
*
- *@return if the data sucessfully synced.
+ *@return if the data successfully synced.
*/
void sync();
void sync_jrnl(JournalImpl* jc, bool firstloop, bool& allWritten);
Modified: store/trunk/cpp/lib/jrnl/lpmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/lpmgr.cpp 2009-07-28 13:01:08 UTC (rev 3523)
+++ store/trunk/cpp/lib/jrnl/lpmgr.cpp 2009-07-29 11:48:45 UTC (rev 3524)
@@ -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;
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-07-28 13:01:08 UTC (rev 3523)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-07-29 11:48:45 UTC (rev 3524)
@@ -528,6 +528,20 @@
iores
rmgr::aio_cycle()
{
+ // Perform validity checks
+ if (_fhdr_rd_outstanding)
+ return RHM_IORES_SUCCESS;
+ if (!_rrfc.is_valid())
+ {
+ init_validation(); // flush outstanding read aio ops (if any), set all pages to UNUSED state, reset counters.
+ _jc->get_earliest_fid(); // determine initial file to read; calls _rrfc.set_findex() to set value
+ // If this file has not yet been written to, return RHM_IORES_EMPTY
+ if (_rrfc.is_void() && !_rrfc.is_wr_aio_outstanding())
+ return RHM_IORES_EMPTY;
+ init_file_header_read(); // send off AIO read request for file header
+ return RHM_IORES_SUCCESS;
+ }
+
int16_t first_uninit = -1;
u_int16_t num_uninit = 0;
u_int16_t num_compl = 0;
@@ -568,21 +582,8 @@
iores
rmgr::init_aio_reads(const int16_t first_uninit, const u_int16_t num_uninit)
{
- if (_fhdr_rd_outstanding)
- return RHM_IORES_SUCCESS;
for (int16_t i=0; i<num_uninit; i++)
{
-
- if (!_rrfc.is_valid())
- {
- init_validation();
- _jc->get_earliest_fid(); // calls _rrfc.set_findex()
- // If this file has not yet been written to, return RHM_IORES_EMPTY
- if (_rrfc.is_void() && !_rrfc.is_wr_aio_outstanding())
- return RHM_IORES_EMPTY;
- init_file_header_read();
- break;
- }
if (_rrfc.is_void()) // Nothing to do; this file not yet written to
break;
15 years, 5 months
rhmessaging commits: r3523 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: aconway
Date: 2009-07-28 09:01:08 -0400 (Tue, 28 Jul 2009)
New Revision: 3523
Modified:
store/trunk/cpp/configure.ac
Log:
Update for changes to generated include files in qpid.
Modified: store/trunk/cpp/configure.ac
===================================================================
--- store/trunk/cpp/configure.ac 2009-07-28 05:13:03 UTC (rev 3522)
+++ store/trunk/cpp/configure.ac 2009-07-28 13:01:08 UTC (rev 3523)
@@ -88,7 +88,7 @@
test -d $QPID_DIR/python -a -d $QPID_DIR/specs || \
AC_MSG_ERROR([$QPID_DIR does not have python and specs directories.])
QPID_LIBS="$QPID_SRC/libqpidbroker.la $QPID_SRC/libqpidcommon.la"
- QPID_CXXFLAGS="-I$QPID_DIR/cpp/include -I$QPID_SRC -I${QPID_SRC}/gen"
+ QPID_CXXFLAGS="-I$QPID_DIR/cpp/include -I$QPID_SRC"
else
fail=0
AC_CHECK_HEADERS([qpid/broker/MessageStore.h], , [fail=1])
15 years, 5 months
rhmessaging commits: r3522 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: astitcher
Date: 2009-07-28 01:13:03 -0400 (Tue, 28 Jul 2009)
New Revision: 3522
Modified:
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
Log:
Use new default constructor for LinkRegistry
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2009-07-24 16:33:46 UTC (rev 3521)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2009-07-28 05:13:03 UTC (rev 3522)
@@ -101,7 +101,7 @@
store = std::auto_ptr<MessageStoreImpl>(new MessageStoreImpl());
store->init(test_dir, 4, 1, 8);
ExchangeRegistry exchanges;
- LinkRegistry links(0);
+ LinkRegistry links;
Timer t;
DtxManager mgr(t);
mgr.setStore (store.get());
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2009-07-24 16:33:46 UTC (rev 3521)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2009-07-28 05:13:03 UTC (rev 3522)
@@ -77,14 +77,14 @@
void recover(MessageStoreImpl& store, ExchangeRegistry& exchanges)
{
QueueRegistry queues;
- LinkRegistry links(0);
+ LinkRegistry links;
recover(store, queues, exchanges, links);
}
void recover(MessageStoreImpl& store, QueueRegistry& queues)
{
ExchangeRegistry exchanges;
- LinkRegistry links(0);
+ LinkRegistry links;
recover(store, queues, exchanges, links);
}
@@ -107,7 +107,7 @@
store.init(test_dir, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
- LinkRegistry links(0);
+ LinkRegistry links;
recover(store, queues, exchanges, links);
@@ -122,7 +122,7 @@
store.init(test_dir, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
- LinkRegistry links(0);
+ LinkRegistry links;
recover(store, queues, exchanges, links);
@@ -418,7 +418,7 @@
QueueRegistry registry;
registry.setStore (&store);
ExchangeRegistry exchanges;
- LinkRegistry links(0);
+ LinkRegistry links;
Timer t;
DtxManager dtx(t);
dtx.setStore (&store);
@@ -622,7 +622,7 @@
store.init(test_dir, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
- LinkRegistry links(0);
+ LinkRegistry links;
//ensure recovery works ok:
recover(store, queues, exchanges, links);
@@ -639,7 +639,7 @@
store.init(test_dir, 4, 1, 8);
ExchangeRegistry exchanges;
QueueRegistry queues;
- LinkRegistry links(0);
+ LinkRegistry links;
//ensure recovery works ok:
recover(store, queues, exchanges, links);
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2009-07-24 16:33:46 UTC (rev 3521)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2009-07-28 05:13:03 UTC (rev 3522)
@@ -131,7 +131,7 @@
store->init(test_dir, 4, 1, 8);
queues = std::auto_ptr<QueueRegistry>(new QueueRegistry);
ExchangeRegistry exchanges;
- LinkRegistry links(0);
+ LinkRegistry links;
Timer t;
DtxManager mgr(t);
mgr.setStore (store.get());
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2009-07-24 16:33:46 UTC (rev 3521)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2009-07-28 05:13:03 UTC (rev 3522)
@@ -358,7 +358,7 @@
Timer t;
ExchangeRegistry exchanges;
queues = std::auto_ptr<QueueRegistry>(new QueueRegistry);
- links = std::auto_ptr<LinkRegistry>(new LinkRegistry(0));
+ links = std::auto_ptr<LinkRegistry>(new LinkRegistry);
dtxmgr = std::auto_ptr<DtxManager>(new DtxManager(t));
dtxmgr->setStore (store.get());
RecoveryManagerImpl recovery(*queues, exchanges, *links, *dtxmgr, 0);
15 years, 5 months
rhmessaging commits: r3521 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-24 12:33:46 -0400 (Fri, 24 Jul 2009)
New Revision: 3521
Modified:
store/trunk/cpp/lib/JournalImpl.h
Log:
Removed uneccessary virtual inheritance in class JournalImpl
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2009-07-24 16:32:04 UTC (rev 3520)
+++ store/trunk/cpp/lib/JournalImpl.h 2009-07-24 16:33:46 UTC (rev 3521)
@@ -68,7 +68,7 @@
inline void cancel() { mrg::journal::slock s(&_gefe_mutex); parent = 0; }
};
- class JournalImpl : public qpid::broker::ExternalQueueStore, public journal::jcntl, public virtual journal::aio_callback
+ class JournalImpl : public qpid::broker::ExternalQueueStore, public journal::jcntl, public journal::aio_callback
{
private:
static qpid::broker::Timer* journalTimerPtr;
15 years, 5 months
rhmessaging commits: r3520 - store/trunk/cpp/rhel4-support.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-24 12:32:04 -0400 (Fri, 24 Jul 2009)
New Revision: 3520
Modified:
store/trunk/cpp/rhel4-support/rhel4.patch
Log:
Updated RHEL4 patch which accommodates changes made in r.3519
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-23 22:46:20 UTC (rev 3519)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-24 16:32:04 UTC (rev 3520)
@@ -1,8 +1,8 @@
Index: tests/.valgrind.supp
===================================================================
---- tests/.valgrind.supp (revision 3484)
+--- tests/.valgrind.supp (revision 3519)
+++ tests/.valgrind.supp (working copy)
-@@ -1,32 +1,74 @@
+@@ -1,33 +1,74 @@
{
- Benign error in libcpg.
- Memcheck:Param
@@ -54,10 +54,11 @@
}
-
{
-- Bogus epoll_ctl error on i386
-- Memcheck:Param
-- epoll_ctl(event)
-- fun:epoll_ctl
+- Probable use after delete problem in boost::unit_test
+- Memcheck:Addr8
+- fun:_ZN5boost9unit_test14framework_implD1Ev
+- fun:exit
+- fun:(below main)
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:_Znw?
15 years, 5 months
rhmessaging commits: r3519 - in store/trunk/cpp/tests: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: astitcher
Date: 2009-07-23 18:46:20 -0400 (Thu, 23 Jul 2009)
New Revision: 3519
Modified:
store/trunk/cpp/tests/.valgrind.supp
store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp
store/trunk/cpp/tests/jrnl/_st_basic.cpp
store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_st_read.cpp
store/trunk/cpp/tests/jrnl/_st_read_txn.cpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp
Log:
Changes to allow the tests to compile/work with gcc 4.4
Modified: store/trunk/cpp/tests/.valgrind.supp
===================================================================
--- store/trunk/cpp/tests/.valgrind.supp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/.valgrind.supp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -24,9 +24,10 @@
}
{
- Bogus epoll_ctl error on i386
- Memcheck:Param
- epoll_ctl(event)
- fun:epoll_ctl
+ Probable use after delete problem in boost::unit_test
+ Memcheck:Addr8
+ fun:_ZN5boost9unit_test14framework_implD1Ev
+ fun:exit
+ fun:(below main)
}
Modified: store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_auto_expand.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -45,7 +45,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
@@ -70,7 +71,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
@@ -107,7 +109,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
Modified: store/trunk/cpp/tests/jrnl/_st_basic.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -53,7 +53,8 @@
string test_name = get_test_name(test_filename, "instantiation");
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
}
catch(const exception& e) { BOOST_FAIL(e.what()); }
@@ -65,7 +66,8 @@
string test_name = get_test_name(test_filename, "initialization");
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
BOOST_CHECK_EQUAL(jc.is_ready(), true);
@@ -81,7 +83,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
@@ -111,7 +114,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<2*NUM_MSGS; m+=2)
{
@@ -144,7 +148,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned n = num_msgs_to_full(NUM_TEST_JFILES, TEST_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
16*MSG_REC_SIZE_DBLKS, true);
@@ -165,7 +170,8 @@
try
{
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
@@ -175,7 +181,8 @@
{
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
@@ -186,7 +193,8 @@
{
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
@@ -210,7 +218,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -218,7 +227,8 @@
{
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
jc.recover_complete();
@@ -241,7 +251,8 @@
for (int m=0; m<2*NUM_MSGS; m+=2)
{
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
if (m == 0)
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS); // First time only
else
@@ -253,7 +264,8 @@
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
}
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(m));
jc.recover_complete();
@@ -273,7 +285,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
// Transient msgs - should not recover
for (int m=0; m<NUM_MSGS; m++)
@@ -292,7 +305,8 @@
string msg;
u_int64_t hrid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
// Recover non-transient msgs
for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
@@ -367,7 +381,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
deq_msg(jc, 0, 1);
@@ -398,7 +413,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
unsigned m;
@@ -427,7 +443,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
// 5 cycles of enqueue/dequeue blocks of half threshold exception size
@@ -452,7 +469,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS);
// 5 cycles of enqueue/dequeue blocks of half threshold exception size
@@ -481,7 +499,8 @@
LARGE_MSG_REC_SIZE_DBLKS)/2;
for (unsigned i=0; i<5; i++)
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
if (i)
{
jc.recover(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS, 0, hrid);
@@ -514,7 +533,8 @@
LARGE_MSG_REC_SIZE_DBLKS)/2;
for (unsigned i=0; i<5; i++)
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
if (i)
{
jc.recover(NUM_DEFAULT_JFILES, false, 0, DEFAULT_JFSIZE_SBLKS, 0, hrid);
Modified: store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -46,7 +46,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -67,7 +68,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -95,7 +97,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -117,7 +120,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -144,7 +148,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -168,7 +173,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -192,7 +198,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -215,7 +222,8 @@
string msg;
string xid;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -57,33 +57,39 @@
bool done() { if (flag || _wstate == NONE) return true; else { flag = true; return false; } }
};
-class test_jrnl : public jcntl, public virtual aio_callback
+class test_jrnl_cb : public aio_callback {
+ virtual void wr_aio_cb(std::vector<data_tok*>& dtokl)
+ {
+ for (std::vector<data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
+ {
+ test_dtok* dtp = static_cast<test_dtok*>(*i);
+ if (dtp->done())
+ delete dtp;
+ }
+ }
+ virtual void rd_aio_cb(std::vector<u_int16_t>& /*pil*/) {}
+};
+
+class test_jrnl : public jcntl
{
+test_jrnl_cb* cb;
+
public:
- test_jrnl(const std::string& jid, const std::string& jdir, const std::string& base_filename) :
- jcntl(jid, jdir, base_filename) {}
+ test_jrnl(const std::string& jid, const std::string& jdir, const std::string& base_filename, test_jrnl_cb& cb0) :
+ jcntl(jid, jdir, base_filename),
+ cb(&cb0) {}
virtual ~test_jrnl() {}
void initialize(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
const u_int32_t jfsize_sblks)
{
jcntl::initialize(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE,
- this);
+ cb);
_jdir.create_dir();
}
void recover(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles, const u_int32_t jfsize_sblks,
vector<string>* txn_list, u_int64_t& highest_rid)
- { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE, this,
+ { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE, cb,
txn_list, highest_rid); }
- virtual void wr_aio_cb(std::vector<data_tok*>& dtokl)
- {
- for (std::vector<data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
- {
- test_dtok* dtp = static_cast<test_dtok*>(*i);
- if (dtp->done())
- delete dtp;
- }
- }
- virtual void rd_aio_cb(std::vector<u_int16_t>& /*pil*/) {}
};
/*
Modified: store/trunk/cpp/tests/jrnl/_st_read.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -59,7 +59,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
}
@@ -78,7 +79,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -111,7 +113,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<500*NUM_MSGS; m+=2)
{
@@ -139,7 +142,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -152,7 +156,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
jc.recover_complete();
@@ -182,7 +187,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS*125; m++)
enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
@@ -195,7 +201,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS*125 - 1));
jc.recover_complete();
@@ -225,7 +232,8 @@
{
string msg;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -238,7 +246,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
for (int m=0; m<NUM_MSGS; m++)
@@ -259,7 +268,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.recover(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS, 0, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
for (int m=0; m<NUM_MSGS; m++)
@@ -301,7 +311,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned m;
for (m=0; m<2*NUM_MSGS; m+=2)
@@ -329,7 +340,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned m;
unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
@@ -370,7 +382,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
for (int i=0; i<10; i++)
{
@@ -406,7 +419,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
unsigned n = num_msgs_to_full(1, read_buffer_size_dblks, MSG_REC_SIZE_DBLKS, true);
Modified: store/trunk/cpp/tests/jrnl/_st_read_txn.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read_txn.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_st_read_txn.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -49,7 +49,8 @@
string rxid;
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -84,7 +85,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -116,7 +118,8 @@
string rxid;
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 1, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -143,7 +146,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -172,7 +176,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
create_xid(xid, 2, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
@@ -199,7 +204,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -228,7 +234,8 @@
bool externalFlag;
create_xid(xid, 3, XID_SIZE);
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -256,7 +263,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
@@ -287,7 +295,8 @@
bool externalFlag;
create_xid(xid, 4, XID_SIZE);
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -323,7 +332,8 @@
bool transientFlag;
bool externalFlag;
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -434,7 +434,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
{
lpmgr lm;
lpmgr_test_helper::initialize(lm, jc, num_jfiles, false, 0);
@@ -461,7 +462,8 @@
::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
{
@@ -497,7 +499,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
{
lpmgr lm;
lpmgr_test_helper::initialize(lm, jc, num_jfiles, false, 0);
@@ -528,7 +531,8 @@
::srand48(1); // init random gen for repeatable tests when using lpmgr_test_helper::prepare_recover()
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
{
@@ -566,7 +570,8 @@
const u_int16_t num_jfiles = 8;
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr lm;
lpmgr_test_helper::initialize(lfm, lm, jc, num_jfiles, true, 0);
@@ -593,7 +598,8 @@
u_int16_t num_jfiles_arr[][2] = {{8, 12}, {4, 7}, {0, 0}}; // end with zeros
try
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
for (unsigned p = 0; p < 8; p++)
{
@@ -624,7 +630,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr lm;
lpmgr_test_helper::initialize(lfm, lm, jc, initial_num_jfiles, true, 0);
@@ -656,7 +663,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr lm;
lpmgr_test_helper::prepare_recover(lfm, initial_num_jfiles);
@@ -681,7 +689,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
const u_int16_t num_jfiles = 8;
lpmgr lm;
@@ -717,7 +726,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr_test_helper::check_limit(lfm, jc, false, 8, 0);
}
@@ -736,7 +746,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr_test_helper::check_limit(lfm, jc, true, 8, 32);
}
@@ -755,7 +766,8 @@
try
{
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lfid_pfid_map lfm(test_name, test_name);
lpmgr_test_helper::check_limit(lfm, jc, true, 8, 0);
}
@@ -797,7 +809,8 @@
for (int test_num = 0; test_num < 250; test_num++)
{
- test_jrnl jc(test_name, test_dir, test_name);
+ test_jrnl_cb cb;
+ test_jrnl jc(test_name, test_dir, test_name, cb);
lpmgr lm;
// 50% chance of recovery except first run and if there is still ae space left
const bool recover_flag = test_num > 0 &&
Modified: store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp 2009-07-23 19:41:47 UTC (rev 3518)
+++ store/trunk/cpp/tests/jrnl/_ut_rec_hdr.cpp 2009-07-23 22:46:20 UTC (rev 3519)
@@ -159,7 +159,7 @@
BOOST_CHECK_EQUAL(fh1._lfid, 0U);
BOOST_CHECK_EQUAL(fh1._fro, std::size_t(0));
BOOST_CHECK_EQUAL(fh1._ts_sec, std::time_t(0));
- BOOST_CHECK_EQUAL(fh1._ts_nsec, uint32_t(0));
+ BOOST_CHECK_EQUAL(fh1._ts_nsec, u_int32_t(0));
BOOST_CHECK(!fh1.get_owi());
}
@@ -178,7 +178,7 @@
BOOST_CHECK_EQUAL(fh2._lfid, lfid);
BOOST_CHECK_EQUAL(fh2._fro, fro);
BOOST_CHECK_EQUAL(fh2._ts_sec, std::time_t(0));
- BOOST_CHECK_EQUAL(fh2._ts_nsec, uint32_t(0));
+ BOOST_CHECK_EQUAL(fh2._ts_nsec, u_int32_t(0));
::clock_gettime(CLOCK_REALTIME, &ts);
fh2.set_time(ts);
BOOST_CHECK_EQUAL(fh2._ts_sec, ts.tv_sec);
15 years, 5 months
rhmessaging commits: r3518 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-23 15:41:47 -0400 (Thu, 23 Jul 2009)
New Revision: 3518
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
store/trunk/cpp/lib/StorePlugin.cpp
Log:
Added a finalize() to MessageStoreImpl which stops all instances of store immediately prior to module unload instead of relying soly on the destructor of each instance.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-07-22 18:51:08 UTC (rev 3517)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-07-23 19:41:47 UTC (rev 3518)
@@ -333,6 +333,7 @@
open(bindingDb, txn.get(), "bindings.db", true);
open(generalDb, txn.get(), "general.db", false);
tplStorePtr.reset(new TplJournalImpl("TplStore", getTplBaseDir(), "tpl", defJournalGetEventsTimeout, defJournalFlushTimeout, agent));
+ journalList["TplStore"]=tplStorePtr.get();
txn.commit();
} catch (const journal::jexception& e) {
txn.abort();
@@ -348,6 +349,15 @@
isInit = true;
}
+void MessageStoreImpl::finalize()
+{
+ for (JournalListMapItr i = journalList.begin(); i != journalList.end(); i++)
+ {
+ JournalImpl* jQueue = i->second;
+ if (jQueue->is_ready()) jQueue->stop(true);
+ }
+}
+
void MessageStoreImpl::pushDown(const char* dirName, const char* bakDirName)
{
DIR* dir = ::opendir(dirName);
@@ -420,7 +430,7 @@
for (std::list<db_ptr >::iterator i = dbs.begin(); i != dbs.end(); i++) {
(*i)->close(0);
}
- if (tplStorePtr->is_ready()) tplStorePtr->stop(true);
+// if (tplStorePtr->is_ready()) tplStorePtr->stop(true);
} catch (const DbException& e) {
QPID_LOG(error, "Error closing BDB databases: " << e.what());
} catch (const journal::jexception& e) {
@@ -490,6 +500,7 @@
jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
std::string("JournalData"), defJournalGetEventsTimeout,
defJournalFlushTimeout, agent);
+ journalList[queue.getName()]=jQueue;
}
value = args.get("qpid.auto_expand");
@@ -526,6 +537,7 @@
JournalImpl* jQueue = static_cast<JournalImpl*>(eqs);
jQueue->delete_jrnl_files();
queue.setExternalQueueStore(0); // will delete the journal if exists
+ journalList.erase(journalList.find(queue.getName()));
}
}
@@ -767,6 +779,7 @@
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
jQueue = new JournalImpl(queueName, getJrnlDir(queueName), std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
+ journalList[queueName] = jQueue;
}
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2009-07-22 18:51:08 UTC (rev 3517)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2009-07-23 19:41:47 UTC (rev 3518)
@@ -92,6 +92,10 @@
typedef std::map<std::string, TplRecover> TplRecoverMap;
typedef TplRecoverMap::const_iterator TplRecoverMapCitr;
+ typedef std::pair<std::string, JournalImpl*> JournalListPair;
+ typedef std::map<std::string, JournalImpl*> JournalListMap;
+ typedef JournalListMap::iterator JournalListMapItr;
+
// Default store settings
static const u_int16_t defNumJrnlFiles = 8;
static const u_int32_t defJrnlFileSizePgs = 24;
@@ -115,6 +119,7 @@
// Pointer to Transaction Prepared List (TPL) journal instance
boost::shared_ptr<TplJournalImpl> tplStorePtr;
TplRecoverMap tplRecoverMap;
+ JournalListMap journalList;
IdSequence queueIdSequence;
IdSequence exchangeIdSequence;
@@ -136,6 +141,7 @@
const char* envPath;
static qpid::sys::Duration defJournalGetEventsTimeout;
static qpid::sys::Duration defJournalFlushTimeout;
+
qmf::com::redhat::rhm::store::Store* mgmtObject;
qpid::sys::Mutex jrnlCreateLock;
qpid::management::ManagementAgent* agent;
@@ -296,6 +302,8 @@
void initManagement (qpid::broker::Broker* broker);
+ void finalize();
+
void truncate();
void create(qpid::broker::PersistableQueue& queue,
Modified: store/trunk/cpp/lib/StorePlugin.cpp
===================================================================
--- store/trunk/cpp/lib/StorePlugin.cpp 2009-07-22 18:51:08 UTC (rev 3517)
+++ store/trunk/cpp/lib/StorePlugin.cpp 2009-07-23 19:41:47 UTC (rev 3518)
@@ -55,6 +55,7 @@
}
store->init(&options);
broker->setStore (store);
+ target.addFinalizer(boost::bind(&StorePlugin::finalize, this));
}
void initialize(Plugin::Target& target)
@@ -63,6 +64,8 @@
((mrg::msgstore::MessageStoreImpl*) store)->initManagement (broker);
}
+ void finalize() { static_cast<mrg::msgstore::MessageStoreImpl*>(store)->finalize(); }
+
const char* id() {return "StorePlugin";}
};
15 years, 5 months
rhmessaging commits: r3517 - mgmt/trunk/mint/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-07-22 14:51:08 -0400 (Wed, 22 Jul 2009)
New Revision: 3517
Added:
mgmt/trunk/mint/bin/mint-database
Log:
A new tool for administering mint's postgresql database
Copied: mgmt/trunk/mint/bin/mint-database (from rev 3516, mgmt/trunk/cumin/bin/cumin-database-destroy)
===================================================================
--- mgmt/trunk/mint/bin/mint-database (rev 0)
+++ mgmt/trunk/mint/bin/mint-database 2009-07-22 18:51:08 UTC (rev 3517)
@@ -0,0 +1,63 @@
+#!/bin/bash -e
+
+if [[ "$EUID" != "0" ]]; then
+ echo "This script must be run as root"
+ exit 2
+fi
+
+function check-basics {
+ # Is it installed?
+ # Is it initialized?
+ # Is it running?
+
+ which rpm > /dev/null
+ rpm -q postgresql-server
+
+ test -d /var/lib/pgsql/data || {
+ echo "The database is not initialized; run '/sbin/service postgresql start'"
+ exit 1
+ }
+
+ /sbin/service postgresql status || {
+ echo "The database is not running; run '/sbin/service postgresql start'"
+ exit 1
+ }
+}
+
+case "$1" in
+ check)
+ check-basics
+
+ # Is it configured to be accessible?
+ # Is it accessible?
+ # Does it have a schema loaded?
+
+ su - postgres -c "psql -c '\q'" || {
+ echo "The database is not accessible"
+ exit 1
+ }
+
+ echo "The database is ready"
+ ;;
+ create)
+ check-basics
+ su - postgres -c "createuser --superuser cumin || :"
+ su - postgres -c "createdb --owner=cumin cumin || :"
+ echo "The database is created"
+ ;;
+ destroy)
+ check-basics
+ su - postgres -c "dropdb cumin || :"
+ su - postgres -c "dropuser cumin || :"
+ echo "The database is destroyed"
+ ;;
+ *)
+ echo "Configure and check the mint database"
+ echo "Usage: mint-database COMMAND"
+ echo "Commands:"
+ echo " check Check the database"
+ echo " create Create the mint user and database"
+ echo " destroy Discard the mint user, database, and all data"
+ exit 1
+ ;;
+esac
15 years, 5 months