Author: kpvdr
Date: 2009-08-04 16:07:22 -0400 (Tue, 04 Aug 2009)
New Revision: 3539
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
Log:
Second fix which addresses the NFS errors in some tests. This fix now allows all tests to
complete on an NFS mounted data-dir (although this is not a good idea from a performance
perspective)
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-08-04 18:43:19 UTC (rev 3538)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-08-04 20:07:22 UTC (rev 3539)
@@ -462,13 +462,6 @@
}
txn->commit(0);
- try {
- journal::jdir::delete_dir(getJrnlBaseDir(),true);
- journal::jdir::delete_dir(getTplBaseDir(),true);
- }
- catch (const journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("truncate() failed: ") + e.what() );
- }
}
void MessageStoreImpl::create(PersistableQueue& queue,
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-08-04 18:43:19 UTC (rev 3538)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-08-04 20:07:22 UTC (rev 3539)
@@ -377,6 +377,7 @@
if (!_readonly_flag)
flush(block_till_aio_cmpl);
_rrfc.finalize();
+ _lpmgr.finalize();
}
u_int16_t
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-08-04 18:43:19 UTC (rev 3538)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-08-04 20:07:22 UTC (rev 3539)
@@ -151,6 +151,7 @@
lfm.get_pfid_list(pfidl);
lfm.get_lfid_list(lfidl);
+ lm.finalize(); // clear all file handles before erasing old journal files
lfm.write_journal(ae, ae_max_jfiles);
lpmgr_test_helper::rcvdat_init(rd, pfidl, ae, ae_max_jfiles);
@@ -230,23 +231,23 @@
const bool init_flag_1)
{
unsigned i_njf = 0;
- while (num_jfiles_arr[i_njf][0] && num_jfiles_arr[i_njf][1])
+ while (num_jfiles_arr[i_njf][0] && num_jfiles_arr[i_njf][1]) // cycle
through each entry in num_jfiles_arr
{
- for (unsigned i1_njf = 0; i1_njf <= 1; i1_njf++)
+ for (unsigned i1_njf = 0; i1_njf <= 1; i1_njf++) // cycle through the two
numbers in each entry of num_jfiles_arr
{
- const u_int16_t num_jfiles_0 = num_jfiles_arr[i_njf][i1_njf == 0];
- const u_int16_t num_jfiles_1 = num_jfiles_arr[i_njf][i1_njf != 0];
+ const u_int16_t num_jfiles_0 = num_jfiles_arr[i_njf][i1_njf == 0]; //
first number in pair
+ const u_int16_t num_jfiles_1 = num_jfiles_arr[i_njf][i1_njf != 0]; //
second number in pair
- for (unsigned i_ae = 0; i_ae < 4; i_ae++)
+ for (unsigned i_ae = 0; i_ae < 4; i_ae++) // cycle through
combinations of enabling AE
{
- const bool ae_0 = i_ae & 0x1;
- const bool ae_1 = i_ae & 0x2;
- for (unsigned i_aemjf = 0; i_aemjf < 4; i_aemjf++)
+ const bool ae_0 = i_ae & 0x1; // first bit: enable AE on first
init
+ const bool ae_1 = i_ae & 0x2; // second bit: enable AE on second
init
+ for (unsigned i_aemjf = 0; i_aemjf < 4; i_aemjf++) // cycle
through combinations of enabling/disabling ae limit
{
- const u_int16_t ae_max_jfiles_0 = i_aemjf & 0x1 ? 3 *
num_jfiles_0 : 0;
- const u_int16_t ae_max_jfiles_1 = i_aemjf & 0x2 ? 4 *
num_jfiles_1 : 0;
+ const u_int16_t ae_max_jfiles_0 = i_aemjf & 0x1 ? 3 *
num_jfiles_0 : 0; // max ae files, 0 = disable max
+ const u_int16_t ae_max_jfiles_1 = i_aemjf & 0x2 ? 4 *
num_jfiles_1 : 0; // max ae files, 0 = disable max
- lpmgr lm;
+ lpmgr lm; // DUT
if (init_flag_0)
initialize(lm, jc, num_jfiles_0, ae_0, ae_max_jfiles_0);
@@ -606,7 +607,7 @@
const bool i_0 = p & 0x01; // first bit
const bool i_1 = p & 0x02; // second bit
const bool f = p & 0x04; // third bit
- lpmgr_test_helper::check_multiple_initialization_recover(lfm, jc,
num_jfiles_arr, i_0,f, i_1);
+ lpmgr_test_helper::check_multiple_initialization_recover(lfm, jc,
num_jfiles_arr, i_0, f, i_1);
}
}
catch(const exception& e) { BOOST_FAIL(e.what()); }