summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-12-01 09:06:01 +0100
committerunknown <jonas@perch.ndb.mysql.com>2006-12-01 09:06:01 +0100
commitc4565431871b766b81ebc00b59a81bd872533e9b (patch)
treef0c97f3d6a8196c2811f4cc8b6c750696d14ece5 /ndb
parent5a1f401f94c2f285547dd0e796be31307c53cfce (diff)
downloadmariadb-git-c4565431871b766b81ebc00b59a81bd872533e9b.tar.gz
ndb - bug#24717
5.0 version Add some extra state to try to prevent sending committedread to node too early ndb/src/kernel/blocks/dbdih/Dbdih.hpp: remove extra virtual-indirection ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: remove extra virtual-indirection ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: remove extra virtual-indirection ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Add retry mechanism to send TCKEYREF (as extra safety) ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Add retry mechanism to send TCKEYREF (as extra safety) ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Add extra state to prevent sending committed reads to node to early (before connection establishment) ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: Add extra state to prevent sending committed reads to node to early (before connection establishment) ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Add extra state to prevent sending committed reads to node to early (before connection establishment) ndb/src/kernel/vm/SimulatedBlock.cpp: remove extra virtual-indirection ndb/src/kernel/vm/SimulatedBlock.hpp: remove extra virtual-indirection
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/blocks/dbdih/Dbdih.hpp2
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihInit.cpp3
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihMain.cpp2
-rw-r--r--ndb/src/kernel/blocks/dblqh/Dblqh.hpp2
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhMain.cpp44
-rw-r--r--ndb/src/kernel/blocks/dbtc/Dbtc.hpp4
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcInit.cpp3
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp36
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp9
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.hpp1
10 files changed, 87 insertions, 19 deletions
diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
index 53e54e96d2b..f1b3897c76f 100644
--- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
+++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
@@ -1602,7 +1602,7 @@ private:
void startInfoReply(Signal *, Uint32 nodeId);
// DIH specifics for execNODE_START_REP (sendDictUnlockOrd)
- void exec_node_start_rep(Signal* signal);
+ void execNODE_START_REP(Signal* signal);
/*
* Lock master DICT. Only current use is by starting node
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
index 2b878034258..aee64687072 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
@@ -269,7 +269,8 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_DICT_LOCK_CONF, &Dbdih::execDICT_LOCK_CONF);
addRecSignal(GSN_DICT_LOCK_REF, &Dbdih::execDICT_LOCK_REF);
-
+ addRecSignal(GSN_NODE_START_REP, &Dbdih::execNODE_START_REP);
+
apiConnectRecord = 0;
connectRecord = 0;
fileRecord = 0;
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index cf3779737c1..cd82b6fc425 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -1390,7 +1390,7 @@ void Dbdih::execNDB_STTOR(Signal* signal)
}//Dbdih::execNDB_STTOR()
void
-Dbdih::exec_node_start_rep(Signal* signal)
+Dbdih::execNODE_START_REP(Signal* signal)
{
/*
* Send DICT_UNLOCK_ORD when this node is SL_STARTED.
diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
index 299cad16ec1..0691e52d0ee 100644
--- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
+++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
@@ -236,6 +236,7 @@
#define ZOPERATION_EVENT_REP 19
#define ZPREP_DROP_TABLE 20
#define ZENABLE_EXPAND_CHECK 21
+#define ZRETRY_TCKEYREF 22
/* ------------------------------------------------------------------------- */
/* NODE STATE DURING SYSTEM RESTART, VARIABLES CNODES_SR_STATE */
@@ -2276,6 +2277,7 @@ private:
void releaseScanrec(Signal* signal);
void seizeScanrec(Signal* signal);
Uint32 sendKeyinfo20(Signal* signal, ScanRecord *, TcConnectionrec *);
+ void sendTCKEYREF(Signal*, Uint32 dst, Uint32 route, Uint32 cnt);
void sendScanFragConf(Signal* signal, Uint32 scanCompleted);
void initCopyrec(Signal* signal);
void initCopyTc(Signal* signal);
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index 4739450884c..3d93ce3fc31 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -464,6 +464,22 @@ void Dblqh::execCONTINUEB(Signal* signal)
return;
}
}
+ case ZRETRY_TCKEYREF:
+ {
+ jam();
+ Uint32 cnt = signal->theData[1];
+ Uint32 ref = signal->theData[2];
+ if (cnt < (10 * 60 * 5))
+ {
+ jam();
+ /**
+ * Only retry for 5 minutes...then hope that API has handled it..somehow
+ */
+ memmove(signal->theData, signal->theData+3, 4*TcKeyRef::SignalLength);
+ sendTCKEYREF(signal, ref, 0, cnt);
+ }
+ return;
+ }
default:
ndbrequire(false);
break;
@@ -2370,7 +2386,7 @@ void Dblqh::noFreeRecordLab(Signal* signal,
tcKeyRef->transId[0] = transid1;
tcKeyRef->transId[1] = transid2;
tcKeyRef->errorCode = errCode;
- sendSignal(apiRef, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+ sendTCKEYREF(signal, apiRef, signal->getSendersBlockRef(), 0);
} else {
jam();
@@ -6576,8 +6592,7 @@ void Dblqh::continueAfterLogAbortWriteLab(Signal* signal)
tcKeyRef->transId[0] = regTcPtr->transid[0];
tcKeyRef->transId[1] = regTcPtr->transid[1];
tcKeyRef->errorCode = regTcPtr->errorCode;
- sendSignal(regTcPtr->applRef,
- GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+ sendTCKEYREF(signal, regTcPtr->applRef, regTcPtr->clientBlockref, 0);
cleanUp(signal);
return;
}//if
@@ -6612,6 +6627,29 @@ void Dblqh::continueAfterLogAbortWriteLab(Signal* signal)
cleanUp(signal);
}//Dblqh::continueAfterLogAbortWriteLab()
+void
+Dblqh::sendTCKEYREF(Signal* signal, Uint32 ref, Uint32 routeRef, Uint32 cnt)
+{
+ const Uint32 nodeId = refToNode(ref);
+ const bool connectedToNode = getNodeInfo(nodeId).m_connected;
+
+ if (likely(connectedToNode))
+ {
+ jam();
+ sendSignal(ref, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+ }
+ else
+ {
+ jam();
+ memmove(signal->theData + 3, signal->theData, 4*TcKeyRef::SignalLength);
+ signal->theData[0] = ZRETRY_TCKEYREF;
+ signal->theData[1] = cnt + 1;
+ signal->theData[2] = ref;
+ sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100,
+ TcKeyRef::SignalLength + 3);
+ }
+}
+
/* ##########################################################################
* ####### MODULE TO HANDLE TC FAILURE #######
*
diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
index bf6ce7129ba..792586d7baf 100644
--- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
@@ -942,7 +942,8 @@ public:
NF_CHECK_SCAN = 0x2,
NF_CHECK_TRANSACTION = 0x4,
NF_CHECK_DROP_TAB = 0x8,
- NF_NODE_FAIL_BITS = 0xF // All bits...
+ NF_NODE_FAIL_BITS = 0xF, // All bits...
+ NF_STARTED = 0x10
};
Uint32 m_nf_bits;
NdbNodeBitmask m_lqh_trans_conf;
@@ -1319,6 +1320,7 @@ private:
void execCOMMITCONF(Signal* signal);
void execABORTCONF(Signal* signal);
void execNODE_FAILREP(Signal* signal);
+ void execNODE_START_REP(Signal* signal);
void execINCL_NODEREQ(Signal* signal);
void execTIME_SIGNAL(Signal* signal);
void execAPI_FAILREQ(Signal* signal);
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
index 7bd308119fc..098373fb3de 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
@@ -290,7 +290,8 @@ Dbtc::Dbtc(const class Configuration & conf):
addRecSignal(GSN_WAIT_DROP_TAB_CONF, &Dbtc::execWAIT_DROP_TAB_CONF);
addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ);
-
+ addRecSignal(GSN_NODE_START_REP, &Dbtc::execNODE_START_REP, true);
+
cacheRecord = 0;
apiConnectRecord = 0;
tcConnectRecord = 0;
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 9edfe7f79bd..a436316f7c9 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -3068,7 +3068,28 @@ void Dbtc::tckeyreq050Lab(Signal* signal)
}//if
}//for
}
- }//if
+
+ if (regTcPtr->tcNodedata[0] != getOwnNodeId())
+ {
+ jam();
+ for (Uint32 i = 0; i < tnoOfBackup + 1; i++)
+ {
+ HostRecordPtr hostPtr;
+ hostPtr.i = regTcPtr->tcNodedata[i];
+ ptrCheckGuard(hostPtr, chostFilesize, hostRecord);
+ if (hostPtr.p->m_nf_bits & HostRecord::NF_STARTED)
+ {
+ jam();
+ if (i != 0)
+ {
+ jam();
+ regTcPtr->tcNodedata[0] = hostPtr.i;
+ }
+ break;
+ }
+ }
+ }//if
+ }
jam();
regTcPtr->lastReplicaNo = 0;
regTcPtr->noOfNodes = 1;
@@ -7003,6 +7024,19 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
}//Dbtc::execNODE_FAILREP()
void
+Dbtc::execNODE_START_REP(Signal* signal)
+{
+ Uint32 nodeId = signal->theData[0];
+ hostptr.i = nodeId;
+ ptrCheckGuard(hostptr, chostFilesize, hostRecord);
+ if (hostptr.p->m_nf_bits == 0)
+ {
+ jam();
+ hostptr.p->m_nf_bits |= HostRecord::NF_STARTED;
+ }
+}
+
+void
Dbtc::checkNodeFailComplete(Signal* signal,
Uint32 failedNodeId,
Uint32 bit)
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index b4787209d55..bbf13528c5c 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -917,15 +917,6 @@ SimulatedBlock::execCONTINUE_FRAGMENTED(Signal * signal){
void
SimulatedBlock::execNODE_START_REP(Signal* signal)
{
- // common stuff for all blocks
-
- // block specific stuff by virtual method override (default empty)
- exec_node_start_rep(signal);
-}
-
-void
-SimulatedBlock::exec_node_start_rep(Signal* signal)
-{
}
#ifdef VM_TRACE_TIME
diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp
index 4a3620a00ab..f7ca4ecbf38 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -424,7 +424,6 @@ private:
void execSIGNAL_DROPPED_REP(Signal* signal);
void execCONTINUE_FRAGMENTED(Signal* signal);
void execNODE_START_REP(Signal* signal);
- virtual void exec_node_start_rep(Signal* signal);
Uint32 c_fragmentIdCounter;
ArrayPool<FragmentInfo> c_fragmentInfoPool;