Author: aconway
Date: 2011-03-01 15:08:48 -0500 (Tue, 01 Mar 2011)
New Revision: 4445
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/tests/cluster/run_python_cluster_tests
Log:
Bug 681026 - Clustered broker exits with invalid-argument error.
In a normal start-up the TplStore had no management object becase it
was created before the management infrastructure. In a cluster
start-up when joining an existing cluster and truncating the store,
the TplStore was created after the management infrastructure and so
did have a management object. This could create a cluster
inconsistency. The fix is to never create a management object for the
TplStore.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2011-02-25 16:42:06 UTC (rev 4444)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2011-03-01 20:08:48 UTC (rev 4445)
@@ -355,8 +355,10 @@
open(generalDb, txn.get(), "general.db", false);
txn.commit();
} catch (...) { txn.abort(); throw; }
-
- tplStorePtr.reset(new TplJournalImpl(timer, "TplStore",
getTplBaseDir(), "tpl", defJournalGetEventsTimeout, defJournalFlushTimeout,
agent));
+ // 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(timer, "TplStore",
getTplBaseDir(), "tpl", defJournalGetEventsTimeout, defJournalFlushTimeout,
0));
isInit = true;
} catch (const DbException& e) {
if (e.get_errno() == DB_VERSION_MISMATCH)
Modified: store/trunk/cpp/tests/cluster/run_python_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_python_cluster_tests 2011-02-25 16:42:06 UTC (rev
4444)
+++ store/trunk/cpp/tests/cluster/run_python_cluster_tests 2011-03-01 20:08:48 UTC (rev
4445)
@@ -39,19 +39,4 @@
TEST_CMD="${QPID_PYTHON_TEST} -m cluster_tests ${CLUSTER_TESTS_IGNORE}
${CLUSTER_TESTS} -DOUTDIR=$OUTDIR"
-if test $COROSYNC; then
- $TEST_CMD
- RETCODE=$?
-else
- sg ais -c "$TEST_CMD"
- RETCODE=$?
-fi
-
-if test x${RETCODE} != x0; then
- exit 1;
-fi
-rm -rf $OUTDIR
-
-../clean.sh
-
-exit 0
+$TEST_CMD && rm -rf $OUTDIR