From e46360bad6eefa787b8110297bc9366e27b36add Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 May 2005 12:16:31 +0200 Subject: [PATCH 01/24] bug#10142 - ndb unhandle resource shortage in unique index code ndb/src/kernel/blocks/dbtc/Dbtc.hpp: remove unneccessary TcSeizedIndexOperation object ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: remove unneccessary TcSeizedIndexOperation object ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: 1) Set transid on starting TCINDXREQ 2) New error code for out of index operation records 3) Check accumulating index op for RNIL before dereferencing it ndb/src/kernel/error/ErrorReporter.cpp: Include NDB version in ndb_X_error.log ndb/src/ndbapi/NdbIndexOperation.cpp: Let failed tcindxreq abort ndb/src/ndbapi/ndberror.c: New error code for out of index operation records --- ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 30 +-------- ndb/src/kernel/blocks/dbtc/DbtcInit.cpp | 4 +- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 81 ++++++++++++------------- ndb/src/kernel/error/ErrorReporter.cpp | 5 +- ndb/src/ndbapi/NdbIndexOperation.cpp | 2 +- ndb/src/ndbapi/ndberror.c | 2 +- 6 files changed, 47 insertions(+), 77 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index fb90ccc8c90..fbd181cae24 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -585,34 +585,8 @@ public: */ ArrayPool c_theIndexOperationPool; - /** - * The list of index operations - */ - ArrayList c_theIndexOperations; - UintR c_maxNumberOfIndexOperations; - struct TcSeizedIndexOperation { - /** - * Next ptr (used in pool/list) - */ - union { - Uint32 nextPool; - Uint32 nextList; - }; - /** - * Prev pointer (used in list) - */ - Uint32 prevList; - }; - - /** - * Pool of seized index operations - */ - ArrayPool c_theSeizedIndexOperationPool; - - typedef Ptr TcSeizedIndexOperationPtr; - /************************** API CONNECT RECORD *********************** * The API connect record contains the connection record to which the * application connects. @@ -650,7 +624,7 @@ public: struct ApiConnectRecord { ApiConnectRecord(ArrayPool & firedTriggerPool, - ArrayPool & seizedIndexOpPool): + ArrayPool & seizedIndexOpPool): theFiredTriggers(firedTriggerPool), isIndexOp(false), theSeizedIndexOperations(seizedIndexOpPool) @@ -763,7 +737,7 @@ public: UintR accumulatingIndexOp; UintR executingIndexOp; UintR tcIndxSendArray[6]; - ArrayList theSeizedIndexOperations; + ArrayList theSeizedIndexOperations; }; typedef Ptr ApiConnectRecordPtr; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index 59c8237f20a..f99b4bf15af 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -65,7 +65,6 @@ void Dbtc::initData() c_theFiredTriggerPool.setSize(c_maxNumberOfFiredTriggers); c_theIndexPool.setSize(c_maxNumberOfIndexes); c_theIndexOperationPool.setSize(c_maxNumberOfIndexOperations); - c_theSeizedIndexOperationPool.setSize(c_maxNumberOfIndexOperations); c_theAttributeBufferPool.setSize(c_transactionBufferSpace); c_firedTriggerHash.setSize((c_maxNumberOfFiredTriggers+10)/10); }//Dbtc::initData() @@ -85,7 +84,7 @@ void Dbtc::initRecords() for(unsigned i = 0; i triggers(c_theFiredTriggerPool); @@ -177,7 +176,6 @@ Dbtc::Dbtc(const class Configuration & conf): c_maxNumberOfFiredTriggers(0), c_theIndexes(c_theIndexPool), c_maxNumberOfIndexes(0), - c_theIndexOperations(c_theIndexOperationPool), c_maxNumberOfIndexOperations(0), m_commitAckMarkerHash(m_commitAckMarkerPool) { diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index efd4c2a46d0..c1ce1613b35 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -11161,16 +11161,21 @@ void Dbtc::execTCINDXREQ(Signal* signal) jam(); // This is a newly started transaction, clean-up releaseAllSeizedIndexOperations(regApiPtr); + + regApiPtr->transid[0] = tcIndxReq->transId1; + regApiPtr->transid[1] = tcIndxReq->transId2; }//if - if (!seizeIndexOperation(regApiPtr, indexOpPtr)) { + ndbout_c("here"); + + if (ERROR_INSERTED(8036) || !seizeIndexOperation(regApiPtr, indexOpPtr)) { jam(); // Failed to allocate index operation TcIndxRef * const tcIndxRef = (TcIndxRef *)signal->getDataPtrSend(); - + tcIndxRef->connectPtr = tcIndxReq->senderData; tcIndxRef->transId[0] = regApiPtr->transid[0]; tcIndxRef->transId[1] = regApiPtr->transid[1]; - tcIndxRef->errorCode = 4000; + tcIndxRef->errorCode = 288; sendSignal(regApiPtr->ndbapiBlockref, GSN_TCINDXREF, signal, TcIndxRef::SignalLength, JBB); return; @@ -11307,15 +11312,17 @@ void Dbtc::execINDXKEYINFO(Signal* signal) TcIndexOperationPtr indexOpPtr; TcIndexOperation* indexOp; - indexOpPtr.i = regApiPtr->accumulatingIndexOp; - indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); - if (saveINDXKEYINFO(signal, - indexOp, - src, - keyInfoLength)) { - jam(); - // We have received all we need - readIndexTable(signal, regApiPtr, indexOp); + if((indexOpPtr.i = regApiPtr->accumulatingIndexOp) != RNIL) + { + indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i); + if (saveINDXKEYINFO(signal, + indexOp, + src, + keyInfoLength)) { + jam(); + // We have received all we need + readIndexTable(signal, regApiPtr, indexOp); + } } } @@ -11338,15 +11345,17 @@ void Dbtc::execINDXATTRINFO(Signal* signal) TcIndexOperationPtr indexOpPtr; TcIndexOperation* indexOp; - indexOpPtr.i = regApiPtr->accumulatingIndexOp; - indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); - if (saveINDXATTRINFO(signal, - indexOp, - src, - attrInfoLength)) { - jam(); - // We have received all we need - readIndexTable(signal, regApiPtr, indexOp); + if((indexOpPtr.i = regApiPtr->accumulatingIndexOp) != RNIL) + { + indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i); + if (saveINDXATTRINFO(signal, + indexOp, + src, + attrInfoLength)) { + jam(); + // We have received all we need + readIndexTable(signal, regApiPtr, indexOp); + } } } @@ -11371,7 +11380,7 @@ bool Dbtc::saveINDXKEYINFO(Signal* signal, releaseIndexOperation(apiConnectptr.p, indexOp); terrorCode = 4000; abortErrorLab(signal); - return true; + return false; } if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) { jam(); @@ -11404,7 +11413,7 @@ bool Dbtc::saveINDXATTRINFO(Signal* signal, releaseIndexOperation(apiConnectptr.p, indexOp); terrorCode = 4000; abortErrorLab(signal); - return true; + return false; } if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) { jam(); @@ -11464,7 +11473,7 @@ void Dbtc::execTCKEYCONF(Signal* signal) jamEntry(); indexOpPtr.i = tcKeyConf->apiConnectPtr; - TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); + TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i); Uint32 confInfo = tcKeyConf->confInfo; /** @@ -11553,7 +11562,7 @@ void Dbtc::execTCKEYREF(Signal* signal) jamEntry(); indexOpPtr.i = tcKeyRef->connectPtr; - TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); + TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i); indexOpPtr.p = indexOp; if (!indexOp) { jam(); @@ -11654,7 +11663,7 @@ void Dbtc::execTRANSID_AI(Signal* signal) jamEntry(); TcIndexOperationPtr indexOpPtr; indexOpPtr.i = transIdAI->connectPtr; - TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); + TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i); indexOpPtr.p = indexOp; if (!indexOp) { jam(); @@ -11762,7 +11771,7 @@ void Dbtc::execTCROLLBACKREP(Signal* signal) jamEntry(); TcIndexOperationPtr indexOpPtr; indexOpPtr.i = tcRollbackRep->connectPtr; - TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); + TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i); indexOpPtr.p = indexOp; tcRollbackRep = (TcRollbackRep *)signal->getDataPtrSend(); tcRollbackRep->connectPtr = indexOp->tcIndxReq.senderData; @@ -12090,16 +12099,7 @@ void Dbtc::executeIndexOperation(Signal* signal, bool Dbtc::seizeIndexOperation(ApiConnectRecord* regApiPtr, TcIndexOperationPtr& indexOpPtr) { - bool seizeOk; - - seizeOk = c_theIndexOperations.seize(indexOpPtr); - if (seizeOk) { - jam(); - TcSeizedIndexOperationPtr seizedIndexOpPtr; - seizeOk &= regApiPtr->theSeizedIndexOperations.seizeId(seizedIndexOpPtr, - indexOpPtr.i); - } - return seizeOk; + return regApiPtr->theSeizedIndexOperations.seize(indexOpPtr); } void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr, @@ -12113,18 +12113,16 @@ void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr, indexOp->expectedTransIdAI = 0; indexOp->transIdAI.release(); regApiPtr->theSeizedIndexOperations.release(indexOp->indexOpId); - c_theIndexOperations.release(indexOp->indexOpId); } void Dbtc::releaseAllSeizedIndexOperations(ApiConnectRecord* regApiPtr) { - TcSeizedIndexOperationPtr seizedIndexOpPtr; + TcIndexOperationPtr seizedIndexOpPtr; regApiPtr->theSeizedIndexOperations.first(seizedIndexOpPtr); while(seizedIndexOpPtr.i != RNIL) { jam(); - TcIndexOperation* indexOp = - c_theIndexOperations.getPtr(seizedIndexOpPtr.i); + TcIndexOperation* indexOp = seizedIndexOpPtr.p; indexOp->indexOpState = IOS_NOOP; indexOp->expectedKeyInfo = 0; @@ -12133,7 +12131,6 @@ void Dbtc::releaseAllSeizedIndexOperations(ApiConnectRecord* regApiPtr) indexOp->attrInfo.release(); indexOp->expectedTransIdAI = 0; indexOp->transIdAI.release(); - c_theIndexOperations.release(seizedIndexOpPtr.i); regApiPtr->theSeizedIndexOperations.next(seizedIndexOpPtr); } regApiPtr->theSeizedIndexOperations.release(); diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 35cd3f099d9..38088fe8f3e 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -130,7 +130,7 @@ ErrorReporter::formatMessage(ErrorCategory type, "Date/Time: %s\nType of error: %s\n" "Message: %s\nFault ID: %d\nProblem data: %s" "\nObject of reference: %s\nProgramName: %s\n" - "ProcessID: %d\nTraceFile: %s\n***EOM***\n", + "ProcessID: %d\nTraceFile: %s\n%s\n***EOM***\n", formatTimeStampString() , errorType[type], lookupErrorMessage(faultID), @@ -139,7 +139,8 @@ ErrorReporter::formatMessage(ErrorCategory type, objRef, my_progname, processId, - theNameOfTheTraceFile ? theNameOfTheTraceFile : ""); + theNameOfTheTraceFile ? theNameOfTheTraceFile : "", + NDB_VERSION_STRING); // Add trailing blanks to get a fixed lenght of the message while (strlen(messptr) <= MESSAGE_LENGTH-3){ diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 39da9c5f5d0..c24e7db5942 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -752,5 +752,5 @@ NdbIndexOperation::receiveTCINDXREF( NdbApiSignal* aSignal) Uint32 errorCode = tcIndxRef->errorCode; theError.code = errorCode; theNdbCon->setOperationErrorCodeAbort(errorCode); - return theNdbCon->OpCompleteFailure(theNdbCon->m_abortOption); + return theNdbCon->OpCompleteFailure(AbortOnError); }//NdbIndexOperation::receiveTCINDXREF() diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index bbc82a21324..71b0ed6a82f 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -169,7 +169,7 @@ ErrorBundle ErrorCodes[] = { { 4021, TR, "Out of Send Buffer space in NDB API" }, { 4022, TR, "Out of Send Buffer space in NDB API" }, { 4032, TR, "Out of Send Buffer space in NDB API" }, - + { 288, TR, "Out of index operations in transaction coordinator (increase MaxNoOfConcurrentIndexOperations)" }, /** * InsufficientSpace */ From 80abad58fc60e4cd93b31f24030340c380ddab77 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 May 2005 18:40:54 +0200 Subject: [PATCH 02/24] bug#10358 - ndb Cluster failure with non started nodes can result in timedout transactions ndb/src/mgmapi/mgmapi.cpp: Increase timeout for restarts ndb/src/ndbapi/ClusterMgr.cpp: Report NFCOMPLETEREP if no alive node exists (instead of no connected node exists) ndb/src/ndbapi/ClusterMgr.hpp: Report NFCOMPLETEREP if no alive node exists (instead of no connected node exists) --- ndb/src/mgmapi/mgmapi.cpp | 6 ++++++ ndb/src/ndbapi/ClusterMgr.cpp | 13 +++++++------ ndb/src/ndbapi/ClusterMgr.hpp | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index a8931fb32ea..863f54ce51a 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -857,7 +857,10 @@ ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, const int * node_list, args.put("initialstart", initial); args.put("nostart", nostart); const Properties *reply; + const int timeout = handle->read_timeout; + handle->read_timeout= 5*60*1000; // 5 minutes reply = ndb_mgm_call(handle, restart_reply, "restart all", &args); + handle->read_timeout= timeout; CHECK_REPLY(reply, -1); BaseString result; @@ -890,7 +893,10 @@ ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, const int * node_list, args.put("nostart", nostart); const Properties *reply; + const int timeout = handle->read_timeout; + handle->read_timeout= 5*60*1000; // 5 minutes reply = ndb_mgm_call(handle, restart_reply, "restart node", &args); + handle->read_timeout= timeout; if(reply != NULL) { BaseString result; reply->get("result", result); diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 1fe0cedbd6c..9603ddf7751 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -66,6 +66,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade): { ndbSetOwnVersion(); clusterMgrThreadMutex = NdbMutex_Create(); + noOfAliveNodes= 0; noOfConnectedNodes= 0; theClusterMgrThread= 0; } @@ -335,9 +336,9 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ node.m_state = apiRegConf->nodeState; if (node.compatible && (node.m_state.startLevel == NodeState::SL_STARTED || node.m_state.startLevel == NodeState::SL_SINGLEUSER)){ - node.m_alive = true; + set_node_alive(node, true); } else { - node.m_alive = false; + set_node_alive(node, false); }//if node.hbSent = 0; node.hbCounter = 0; @@ -360,7 +361,7 @@ ClusterMgr::execAPI_REGREF(const Uint32 * theData){ assert(node.defined == true); node.compatible = false; - node.m_alive = false; + set_node_alive(node, false); node.m_state = NodeState::SL_NOTHING; node.m_info.m_version = ref->version; @@ -437,7 +438,7 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){ Node & theNode = theNodes[nodeId]; - theNode.m_alive = false; + set_node_alive(theNode, false); if(theNode.connected) theFacade.doDisconnect(nodeId); @@ -449,8 +450,8 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){ } theNode.nfCompleteRep = false; - - if(noOfConnectedNodes == 0){ + + if(noOfAliveNodes == 0){ NFCompleteRep rep; for(Uint32 i = 1; i Date: Thu, 5 May 2005 10:34:39 +0200 Subject: [PATCH 03/24] bug#10142 - ndb unique index post review fixes ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: remove printout abort transaction instead of operation. concider m_exec_flag --- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index c1ce1613b35..ca97a5bce6d 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -11165,19 +11165,14 @@ void Dbtc::execTCINDXREQ(Signal* signal) regApiPtr->transid[0] = tcIndxReq->transId1; regApiPtr->transid[1] = tcIndxReq->transId2; }//if - ndbout_c("here"); if (ERROR_INSERTED(8036) || !seizeIndexOperation(regApiPtr, indexOpPtr)) { jam(); // Failed to allocate index operation - TcIndxRef * const tcIndxRef = (TcIndxRef *)signal->getDataPtrSend(); - - tcIndxRef->connectPtr = tcIndxReq->senderData; - tcIndxRef->transId[0] = regApiPtr->transid[0]; - tcIndxRef->transId[1] = regApiPtr->transid[1]; - tcIndxRef->errorCode = 288; - sendSignal(regApiPtr->ndbapiBlockref, GSN_TCINDXREF, signal, - TcIndxRef::SignalLength, JBB); + terrorCode = 288; + regApiPtr->m_exec_flag |= TcKeyReq::getExecuteFlag(tcIndxRequestInfo); + apiConnectptr = transPtr; + abortErrorLab(signal); return; } TcIndexOperation* indexOp = indexOpPtr.p; From bdb85181e5d3d6051a966159d585d4eea41c3c6b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 May 2005 11:09:00 +0200 Subject: [PATCH 04/24] ndb - testNodeRestart -n LateCommit increase no of rows so that the node failure will "guaranteed" produce an aborted transaction ndb/test/ndbapi/testNodeRestart.cpp: increase no of rows so that the node failure will "guaranteed" produce an aborted transaction --- ndb/test/ndbapi/testNodeRestart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index a50df91908c..9c25d715d07 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -359,7 +359,7 @@ int runLateCommit(NDBT_Context* ctx, NDBT_Step* step){ if(hugoOps.startTransaction(pNdb) != 0) return NDBT_FAILED; - if(hugoOps.pkUpdateRecord(pNdb, 1) != 0) + if(hugoOps.pkUpdateRecord(pNdb, 1, 128) != 0) return NDBT_FAILED; if(hugoOps.execute_NoCommit(pNdb) != 0) From b9552611304014e56ad42a59d53445390aaa6295 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 May 2005 14:44:43 +0200 Subject: [PATCH 05/24] ndb - add support for mysql servers in autotest --- ndb/test/run-test/main.cpp | 41 ++++++++++++++++------------------ ndb/test/run-test/run-test.hpp | 1 + 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 02c2cc862a3..842f658f5b6 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -116,10 +116,7 @@ main(int argc, const char ** argv){ */ if(restart){ g_logger.info("(Re)starting ndb processes"); - if(!stop_processes(g_config, atrt_process::NDB_MGM)) - goto end; - - if(!stop_processes(g_config, atrt_process::NDB_DB)) + if(!stop_processes(g_config, ~0)) goto end; if(!start_processes(g_config, atrt_process::NDB_MGM)) @@ -142,6 +139,9 @@ main(int argc, const char ** argv){ goto end; started: + if(!start_processes(g_config, p_servers)) + goto end; + g_logger.info("Ndb start completed"); } @@ -158,9 +158,6 @@ main(int argc, const char ** argv){ if(!setup_test_case(g_config, test_case)) goto end; - if(!start_processes(g_config, p_servers)) - goto end; - if(!start_processes(g_config, p_clients)) goto end; @@ -201,9 +198,6 @@ main(int argc, const char ** argv){ if(!stop_processes(g_config, p_clients)) goto end; - if(!stop_processes(g_config, p_servers)) - goto end; - if(!gather_result(g_config, &result)) goto end; @@ -476,21 +470,18 @@ setup_config(atrt_config& config){ proc.m_proc.m_path.assign(dir).append("/libexec/mysqld"); proc.m_proc.m_args = "--core-file --ndbcluster"; proc.m_proc.m_cwd.appfmt("%d.mysqld", index); - if(mysql_port_offset > 0 || g_mysqld_use_base){ - // setup mysql specific stuff - const char * basedir = proc.m_proc.m_cwd.c_str(); - proc.m_proc.m_args.appfmt("--datadir=%s", basedir); - proc.m_proc.m_args.appfmt("--pid-file=%s/mysql.pid", basedir); - proc.m_proc.m_args.appfmt("--socket=%s/mysql.sock", basedir); - proc.m_proc.m_args.appfmt("--port=%d", - g_default_base_port-(++mysql_port_offset)); - } } else if(split1[0] == "api"){ proc.m_type = atrt_process::NDB_API; proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api"); proc.m_proc.m_path = ""; proc.m_proc.m_args = ""; proc.m_proc.m_cwd.appfmt("%d.ndb_api", index); + } else if(split1[0] == "mysql"){ + proc.m_type = atrt_process::MYSQL_CLIENT; + proc.m_proc.m_name.assfmt("%d-%s", index, "mysql"); + proc.m_proc.m_path = ""; + proc.m_proc.m_args = ""; + proc.m_proc.m_cwd.appfmt("%d.mysql", index); } else { g_logger.critical("%s:%d: Unhandled process type: %s", g_process_config_filename, lineno, @@ -913,6 +904,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){ tc.m_report= true; else tc.m_report= false; + + if(p.get("run-all", &mt) && strcmp(mt, "yes") == 0) + tc.m_run_all= true; + else + tc.m_run_all= false; return true; } @@ -928,16 +924,17 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){ size_t i = 0; for(; im_base_dir.c_str(), tc.m_command.c_str()); proc.m_proc.m_args.assign(tc.m_args); - break; + if(!tc.m_run_all) + break; } } for(i++; i Date: Fri, 6 May 2005 15:37:51 +0200 Subject: [PATCH 06/24] ndb - autotest update make-config script ndb/test/run-test/make-config.sh: update make-config script --- ndb/test/run-test/make-config.sh | 509 ++++--------------------------- 1 file changed, 64 insertions(+), 445 deletions(-) diff --git a/ndb/test/run-test/make-config.sh b/ndb/test/run-test/make-config.sh index 5394b0654d4..f76ee320a99 100755 --- a/ndb/test/run-test/make-config.sh +++ b/ndb/test/run-test/make-config.sh @@ -1,465 +1,84 @@ #!/bin/sh -# NAME -# make-config.sh - Makes a config file for mgm server -# -# SYNOPSIS -# make-config.sh [ -t