#At file:///home/zhl/mysql/wl4397/
3074 Leonard Zhou 2008-12-16 [merge]
Merge
modified:
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/test/ndbapi/testNodeRestart.cpp
storage/ndb/test/run-test/conf-upgrade.cnf
storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2008-12-12 14:44:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2008-12-15 19:41:01 +0000
@@ -5181,6 +5181,12 @@ void Dbdih::startGcpMasterTakeOver(Signa
signal->theData[0] = NDB_LE_GCP_TakeoverStarted;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 1, JBB);
+ /**
+ * save own value...
+ * to be able to check values returned in MASTER_GCPCONF
+ */
+ m_gcp_save.m_master.m_new_gci = m_gcp_save.m_gci;
+
setLocalNodefailHandling(signal, oldMasterId, NF_GCP_TAKE_OVER);
}//Dbdih::handleNewMaster()
@@ -5432,6 +5438,17 @@ void Dbdih::execMASTER_GCPCONF(Signal* s
ndbassert(ok); // Unhandled case...
ok = false;
+ /**
+ * GCI should differ with atmost one
+ */
+ ndbrequire(saveGCI == m_gcp_save.m_gci ||
+ saveGCI == m_gcp_save.m_gci + 1 ||
+ saveGCI + 1 == m_gcp_save.m_gci);
+ if (saveGCI > m_gcp_save.m_master.m_new_gci)
+ {
+ jam();
+ m_gcp_save.m_master.m_new_gci = saveGCI;
+ }
switch(saveState){
case MasterGCPConf::GCP_SAVE_IDLE:
jam();
@@ -5546,7 +5563,6 @@ void Dbdih::MASTER_GCPhandling(Signal* s
else
{
ok = false;
- m_gcp_save.m_master.m_new_gci = m_gcp_save.m_gci;
switch(m_gcp_save.m_master.m_state){
case GcpSave::GCP_SAVE_IDLE:
jam();
@@ -8923,6 +8939,21 @@ void Dbdih::execGCP_NODEFINISH(Signal* s
sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 1000, 1);
return;
}
+ else if (ERROR_INSERTED(7216))
+ {
+ infoEvent("GCP_SAVE all/%u", c_error_insert_extra);
+ NodeRecordPtr nodePtr;
+ nodePtr.i = c_error_insert_extra;
+ ptrAss(nodePtr, nodeRecord);
+
+ removeAlive(nodePtr);
+ sendLoopMacro(GCP_SAVEREQ, sendGCP_SAVEREQ, RNIL);
+ insertAlive(nodePtr);
+ signal->theData[0] = 9999;
+ sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 1000, 1);
+ c_GCP_SAVEREQ_Counter.setWaitingFor(c_error_insert_extra);
+ return;
+ }
#endif
sendLoopMacro(GCP_SAVEREQ, sendGCP_SAVEREQ, RNIL);
@@ -16073,6 +16104,12 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal
SET_ERROR_INSERT_VALUE2(7214, signal->theData[1]);
return;
}
+
+ DECLARE_DUMP0(DBDIH, 7216, "Set error 7216 with extra arg")
+ {
+ SET_ERROR_INSERT_VALUE2(7216, signal->theData[1]);
+ return;
+ }
}//Dbdih::execDUMP_STATE_ORD()
void
=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2008-12-12 14:30:54 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2008-12-15 19:41:01 +0000
@@ -2809,15 +2809,7 @@ NdbDictionaryImpl::optimizeTable(const N
NdbOptimizeTableHandleImpl &h)
{
DBUG_ENTER("NdbDictionaryImpl::optimizeTableGlobal(const NdbTableImpl)");
- /**
- * make sure we get global table object here
- */
- NdbTableImpl *g_table = getTableGlobal(t.getName());
- if (g_table == NULL) {
- m_ndb.getNdbError(getNdbError().code);
- DBUG_RETURN(-1);
- }
- DBUG_RETURN(h.init(&m_ndb, *g_table));
+ DBUG_RETURN(h.init(&m_ndb, t));
}
int
@@ -2825,16 +2817,7 @@ NdbDictionaryImpl::optimizeIndex(const N
NdbOptimizeIndexHandleImpl &h)
{
DBUG_ENTER("NdbDictionaryImpl::optimizeIndexGlobal(const NdbIndexImpl)");
- /**
- * make sure we get global index object here
- */
- const NdbIndexImpl * g_index = getIndexGlobal(index.getName(),
- index.getTable());
- if (g_index == NULL) {
- m_ndb.getNdbError(getNdbError().code);
- DBUG_RETURN(-1);
- }
- DBUG_RETURN(h.init(&m_ndb, *g_index));
+ DBUG_RETURN(h.init(&m_ndb, index));
}
int
=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp 2008-12-08 13:58:15 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp 2008-12-15 19:41:01 +0000
@@ -3447,6 +3447,46 @@ runBug41295(NDBT_Context* ctx, NDBT_Step
return NDBT_OK;
}
+int
+runBug41469(NDBT_Context* ctx, NDBT_Step* step)
+{
+ NdbRestarter res;
+
+ if (res.getNumDbNodes() < 4)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+
+ int loops = ctx->getNumLoops();
+
+ int val0[] = { 7216, 0 };
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ for (int i = 0; i<loops; i++)
+ {
+ int master = res.getMasterNodeId();
+ int next = res.getNextMasterNodeId(master);
+
+ if (res.dumpStateOneNode(master, val2, 2))
+ return NDBT_FAILED;
+
+ ndbout_c("stopping %u, err 7216 (next: %u)", master, next);
+ val0[1] = next;
+ if (res.dumpStateOneNode(master, val0, 2))
+ return NDBT_FAILED;
+
+ res.waitNodesNoStart(&master, 1);
+ res.startNodes(&master, 1);
+ ndbout_c("waiting for cluster started");
+ if (res.waitClusterStarted())
+ {
+ return NDBT_FAILED;
+ }
+ }
+ ctx->stopTest();
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
"Test that one node at a time can be stopped and then restarted "\
@@ -3918,6 +3958,12 @@ TESTCASE("Bug41295", "")
STEP(runBug41295);
FINALIZER(runClearTable);
}
+TESTCASE("Bug41469", ""){
+ INITIALIZER(runLoadTable);
+ STEP(runBug41469);
+ STEP(runScanUpdateUntilStopped);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){
=== modified file 'storage/ndb/test/run-test/conf-upgrade.cnf'
--- a/storage/ndb/test/run-test/conf-upgrade.cnf 2008-12-12 08:04:28 +0000
+++ b/storage/ndb/test/run-test/conf-upgrade.cnf 2008-12-15 20:06:12 +0000
@@ -10,6 +10,10 @@ fix-nodeid=1
[mysqld]
skip-innodb
loose-skip-bdb
+socket=mysql.sock
+
+[client]
+protocol=tcp
[cluster_config.4node]
ndb_mgmd = CHOOSE_host1,CHOOSE_host1
=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt 2008-12-09 17:15:12 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2008-12-15 19:41:01 +0000
@@ -954,6 +954,10 @@ max-time: 5000
cmd: testNodeRestart
args: -n GCP T1
+max-time: 1200
+cmd: testNodeRestart
+args: -n Bug41469 T1
+
max-time: 180
cmd: testIndex
args: -n Bug28804 T1 T6
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (zhou.li:3074) | Leonard Zhou | 16 Dec |