Commit 1192517a authored by tomas@poseidon.(none)'s avatar tomas@poseidon.(none)

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb

into poseidon.(none):/home/tomas/mysql-4.1-ndb
parents e97e08b2 eaff9908
...@@ -5,7 +5,7 @@ Next DBACC 3001 ...@@ -5,7 +5,7 @@ Next DBACC 3001
Next DBTUP 4007 Next DBTUP 4007
Next DBLQH 5040 Next DBLQH 5040
Next DBDICT 6006 Next DBDICT 6006
Next DBDIH 7173 Next DBDIH 7174
Next DBTC 8035 Next DBTC 8035
Next CMVMI 9000 Next CMVMI 9000
Next BACKUP 10022 Next BACKUP 10022
...@@ -387,6 +387,11 @@ Backup Stuff: ...@@ -387,6 +387,11 @@ Backup Stuff:
5028: Crash when receiving LQHKEYREQ (in non-master) 5028: Crash when receiving LQHKEYREQ (in non-master)
Failed Create Table:
--------------------
7173: Create table failed due to not sufficient number of fragment or
replica records.
Drop Table/Index: Drop Table/Index:
----------------- -----------------
4001: Crash on REL_TABMEMREQ in TUP 4001: Crash on REL_TABMEMREQ in TUP
......
...@@ -6425,6 +6425,10 @@ void Dbdih::execDIADDTABREQ(Signal* signal) ...@@ -6425,6 +6425,10 @@ void Dbdih::execDIADDTABREQ(Signal* signal)
tabPtr.p->totalfragments = noFragments; tabPtr.p->totalfragments = noFragments;
ndbrequire(noReplicas == cnoReplicas); // Only allowed ndbrequire(noReplicas == cnoReplicas); // Only allowed
if (ERROR_INSERTED(7173)) {
addtabrefuseLab(signal, connectPtr, ZREPLERROR1);
return;
}
if ((noReplicas * noFragments) > cnoFreeReplicaRec) { if ((noReplicas * noFragments) > cnoFreeReplicaRec) {
jam(); jam();
addtabrefuseLab(signal, connectPtr, ZREPLERROR1); addtabrefuseLab(signal, connectPtr, ZREPLERROR1);
...@@ -6736,13 +6740,15 @@ void Dbdih::tableDeleteLab(Signal* signal, FileRecordPtr filePtr) ...@@ -6736,13 +6740,15 @@ void Dbdih::tableDeleteLab(Signal* signal, FileRecordPtr filePtr)
void Dbdih::releaseTable(TabRecordPtr tabPtr) void Dbdih::releaseTable(TabRecordPtr tabPtr)
{ {
FragmentstorePtr fragPtr; FragmentstorePtr fragPtr;
for (Uint32 fragId = 0; fragId < tabPtr.p->totalfragments; fragId++) { if (tabPtr.p->noOfFragChunks > 0) {
jam(); for (Uint32 fragId = 0; fragId < tabPtr.p->totalfragments; fragId++) {
getFragstore(tabPtr.p, fragId, fragPtr); jam();
releaseReplicas(fragPtr.p->storedReplicas); getFragstore(tabPtr.p, fragId, fragPtr);
releaseReplicas(fragPtr.p->oldStoredReplicas); releaseReplicas(fragPtr.p->storedReplicas);
}//for releaseReplicas(fragPtr.p->oldStoredReplicas);
releaseFragments(tabPtr); }//for
releaseFragments(tabPtr);
}
if (tabPtr.p->tabFile[0] != RNIL) { if (tabPtr.p->tabFile[0] != RNIL) {
jam(); jam();
releaseFile(tabPtr.p->tabFile[0]); releaseFile(tabPtr.p->tabFile[0]);
...@@ -6875,9 +6881,6 @@ Uint32 Dbdih::extractNodeInfo(const Fragmentstore * fragPtr, Uint32 nodes[]) ...@@ -6875,9 +6881,6 @@ Uint32 Dbdih::extractNodeInfo(const Fragmentstore * fragPtr, Uint32 nodes[])
return nodeCount; return nodeCount;
}//Dbdih::extractNodeInfo() }//Dbdih::extractNodeInfo()
#define NO_OF_FRAGS_PER_CHUNK 16
#define LOG_NO_OF_FRAGS_PER_CHUNK 4
void void
Dbdih::getFragstore(TabRecord * tab, //In parameter Dbdih::getFragstore(TabRecord * tab, //In parameter
Uint32 fragNo, //In parameter Uint32 fragNo, //In parameter
......
...@@ -643,8 +643,12 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ...@@ -643,8 +643,12 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
cfg.put(CFG_DIH_CONNECT, cfg.put(CFG_DIH_CONNECT,
noOfOperations + noOfTransactions + 46); noOfOperations + noOfTransactions + 46);
Uint32 noFragPerTable= ((noOfDBNodes + NO_OF_FRAGS_PER_CHUNK - 1) >>
LOG_NO_OF_FRAGS_PER_CHUNK) <<
LOG_NO_OF_FRAGS_PER_CHUNK;
cfg.put(CFG_DIH_FRAG_CONNECT, cfg.put(CFG_DIH_FRAG_CONNECT,
NO_OF_FRAG_PER_NODE * noOfMetaTables * noOfDBNodes); noFragPerTable * noOfMetaTables);
int temp; int temp;
temp = noOfReplicas - 2; temp = noOfReplicas - 2;
...@@ -655,7 +659,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ...@@ -655,7 +659,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
cfg.put(CFG_DIH_MORE_NODES, cfg.put(CFG_DIH_MORE_NODES,
temp * NO_OF_FRAG_PER_NODE * temp * NO_OF_FRAG_PER_NODE *
noOfMetaTables * noOfDBNodes); noOfMetaTables * noOfDBNodes);
cfg.put(CFG_DIH_REPLICAS, cfg.put(CFG_DIH_REPLICAS,
NO_OF_FRAG_PER_NODE * noOfMetaTables * NO_OF_FRAG_PER_NODE * noOfMetaTables *
noOfDBNodes * noOfReplicas); noOfDBNodes * noOfReplicas);
......
...@@ -150,6 +150,13 @@ ...@@ -150,6 +150,13 @@
#define NO_OF_FRAG_PER_NODE 1 #define NO_OF_FRAG_PER_NODE 1
#define MAX_FRAG_PER_NODE 8 #define MAX_FRAG_PER_NODE 8
/**
* DIH allocates fragments in chunk for fast find of fragment record.
* These parameters define chunk size and log of chunk size.
*/
#define NO_OF_FRAGS_PER_CHUNK 8
#define LOG_NO_OF_FRAGS_PER_CHUNK 3
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
// To avoid synching too big chunks at a time we synch after writing // To avoid synching too big chunks at a time we synch after writing
// a certain number of data/UNDO pages. (e.g. 2 MBytes). // a certain number of data/UNDO pages. (e.g. 2 MBytes).
......
...@@ -1002,11 +1002,13 @@ int runGetPrimaryKey(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -1002,11 +1002,13 @@ int runGetPrimaryKey(NDBT_Context* ctx, NDBT_Step* step){
return result; return result;
} }
int struct ErrorCodes { int error_id; bool crash;};
ErrorCodes
NF_codes[] = { NF_codes[] = {
6003 {6003, true},
,6004 {6004, true},
//,6005 //,6005, true,
{7173, false}
}; };
int int
...@@ -1042,7 +1044,9 @@ runNF1(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -1042,7 +1044,9 @@ runNF1(NDBT_Context* ctx, NDBT_Step* step){
for(int i = 0; i<sz; i++){ for(int i = 0; i<sz; i++){
int rand = myRandom48(restarter.getNumDbNodes()); int rand = myRandom48(restarter.getNumDbNodes());
int nodeId = restarter.getRandomNotMasterNodeId(rand); int nodeId = restarter.getRandomNotMasterNodeId(rand);
int error = NF_codes[i]; struct ErrorCodes err_struct = NF_codes[i];
int error = err_struct.error_id;
bool crash = err_struct.crash;
g_info << "NF1: node = " << nodeId << " error code = " << error << endl; g_info << "NF1: node = " << nodeId << " error code = " << error << endl;
...@@ -1057,31 +1061,33 @@ runNF1(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -1057,31 +1061,33 @@ runNF1(NDBT_Context* ctx, NDBT_Step* step){
CHECK2(dict->createTable(* pTab) == 0, CHECK2(dict->createTable(* pTab) == 0,
"failed to create table"); "failed to create table");
CHECK2(restarter.waitNodesNoStart(&nodeId, 1) == 0, if (crash) {
CHECK2(restarter.waitNodesNoStart(&nodeId, 1) == 0,
"waitNodesNoStart failed"); "waitNodesNoStart failed");
if(myRandom48(100) > 50){ if(myRandom48(100) > 50){
CHECK2(restarter.startNodes(&nodeId, 1) == 0, CHECK2(restarter.startNodes(&nodeId, 1) == 0,
"failed to start node"); "failed to start node");
CHECK2(restarter.waitClusterStarted() == 0, CHECK2(restarter.waitClusterStarted() == 0,
"waitClusterStarted failed"); "waitClusterStarted failed");
CHECK2(dict->dropTable(pTab->getName()) == 0, CHECK2(dict->dropTable(pTab->getName()) == 0,
"drop table failed"); "drop table failed");
} else { } else {
CHECK2(dict->dropTable(pTab->getName()) == 0, CHECK2(dict->dropTable(pTab->getName()) == 0,
"drop table failed"); "drop table failed");
CHECK2(restarter.startNodes(&nodeId, 1) == 0, CHECK2(restarter.startNodes(&nodeId, 1) == 0,
"failed to start node"); "failed to start node");
CHECK2(restarter.waitClusterStarted() == 0, CHECK2(restarter.waitClusterStarted() == 0,
"waitClusterStarted failed"); "waitClusterStarted failed");
} }
CHECK2(restarter.dumpStateOneNode(nodeId, &val, 1) == 0, CHECK2(restarter.dumpStateOneNode(nodeId, &val, 1) == 0,
"Failed to set LCP to min value"); "Failed to set LCP to min value");
}
} }
} }
end: end:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment