summaryrefslogtreecommitdiff
path: root/storage/ndb
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-12-01 11:32:52 +0100
committerunknown <jonas@perch.ndb.mysql.com>2006-12-01 11:32:52 +0100
commit2b1df53702f63789b9ddd5e51b4a392ae9ecfd5e (patch)
treeb26f29e4fc7256dd0c74d81499ff7d08a57be046 /storage/ndb
parentedfeedb6b548561887c72a51d755eced5e752b37 (diff)
parentfae72af5aa4940dd331bac3886625aa92abd6046 (diff)
downloadmariadb-git-2b1df53702f63789b9ddd5e51b4a392ae9ecfd5e.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp: Auto merged storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: Auto merged storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Auto merged storage/ndb/src/kernel/vm/SimulatedBlock.cpp: Auto merged storage/ndb/src/kernel/vm/SimulatedBlock.hpp: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged storage/ndb/src/ndbapi/NdbTransaction.cpp: Auto merged storage/ndb/src/ndbapi/TransporterFacade.cpp: Auto merged storage/ndb/src/ndbapi/ndberror.c: Auto merged storage/ndb/test/run-test/daily-basic-tests.txt: Auto merged
Diffstat (limited to 'storage/ndb')
-rw-r--r--storage/ndb/include/kernel/GlobalSignalNumbers.h3
-rw-r--r--storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp2
-rw-r--r--storage/ndb/include/kernel/signaldata/RouteOrd.hpp35
-rw-r--r--storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp5
-rw-r--r--storage/ndb/src/common/debugger/signaldata/SignalNames.cpp2
-rw-r--r--storage/ndb/src/common/util/NdbSqlUtil.cpp19
-rw-r--r--storage/ndb/src/kernel/blocks/ERROR_codes.txt10
-rw-r--r--storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp58
-rw-r--r--storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp3
-rw-r--r--storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp5
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp3
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp64
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp3
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp93
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp1
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp4
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp10
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp1
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp7
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp12
-rw-r--r--storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp5
-rw-r--r--storage/ndb/src/kernel/vm/SimulatedBlock.cpp9
-rw-r--r--storage/ndb/src/kernel/vm/SimulatedBlock.hpp1
-rw-r--r--storage/ndb/src/mgmclient/CommandInterpreter.cpp107
-rw-r--r--storage/ndb/src/mgmsrv/MgmtSrvr.cpp20
-rw-r--r--storage/ndb/src/ndbapi/NdbTransaction.cpp11
-rw-r--r--storage/ndb/src/ndbapi/SignalSender.cpp9
-rw-r--r--storage/ndb/src/ndbapi/TransporterFacade.cpp25
-rw-r--r--storage/ndb/src/ndbapi/ndberror.c1
-rw-r--r--storage/ndb/test/ndbapi/testNodeRestart.cpp74
-rw-r--r--storage/ndb/test/ndbapi/testScan.cpp40
-rw-r--r--storage/ndb/test/run-test/daily-basic-tests.txt12
36 files changed, 540 insertions, 122 deletions
diff --git a/storage/ndb/include/kernel/GlobalSignalNumbers.h b/storage/ndb/include/kernel/GlobalSignalNumbers.h
index b449915d756..49f937ba221 100644
--- a/storage/ndb/include/kernel/GlobalSignalNumbers.h
+++ b/storage/ndb/include/kernel/GlobalSignalNumbers.h
@@ -126,7 +126,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_ACC_ABORTCONF 67
/* 68 not unused */
/* 69 not unused */
-/* 70 unused */
#define GSN_UPDATE_FRAG_DIST_KEY_ORD 70
#define GSN_ACC_ABORTREQ 71
#define GSN_ACC_CHECK_SCAN 72
@@ -183,7 +182,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_CNTR_START_CONF 118
#define GSN_CNTR_START_REP 119
/* 120 not unused */
-/* 121 unused */
+#define GSN_ROUTE_ORD 121
/* 122 unused */
/* 123 unused */
/* 124 unused */
diff --git a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
index 8172a034985..1f89d9f09ea 100644
--- a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
+++ b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
@@ -141,7 +141,7 @@ public:
TuxSetLogFlags = 12002,
TuxMetaDataJunk = 12009,
- DumpTsman = 9002,
+ DumpTsman = 9800,
DumpLgman = 10000,
DumpPgman = 11000
};
diff --git a/storage/ndb/include/kernel/signaldata/RouteOrd.hpp b/storage/ndb/include/kernel/signaldata/RouteOrd.hpp
new file mode 100644
index 00000000000..fb4de08dd53
--- /dev/null
+++ b/storage/ndb/include/kernel/signaldata/RouteOrd.hpp
@@ -0,0 +1,35 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef ROUTE_ORD_HPP
+#define ROUTE_ORD_HPP
+
+#include "SignalData.hpp"
+#include <NodeBitmask.hpp>
+
+/**
+ * Request to allocate node id
+ */
+struct RouteOrd {
+ STATIC_CONST( SignalLength = 4 );
+
+ Uint32 dstRef;
+ Uint32 srcRef;
+ Uint32 gsn;
+ Uint32 cnt;
+};
+
+#endif
diff --git a/storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp b/storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp
index 7410db44aa3..5a98e440286 100644
--- a/storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp
+++ b/storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp
@@ -20,9 +20,10 @@
bool
printBACKUP_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
BackupReq* sig = (BackupReq*)theData;
- fprintf(output, " senderData: %d DataLength: %d\n",
+ fprintf(output, " senderData: %d DataLength: %d flags: %d\n",
sig->senderData,
- sig->backupDataLen);
+ sig->backupDataLen,
+ sig->flags);
return true;
}
diff --git a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
index 259f7480e8f..25a491422ef 100644
--- a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
+++ b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
@@ -635,5 +635,7 @@ const GsnName SignalNames [] = {
,{ GSN_UPDATE_FRAG_DIST_KEY_ORD, "UPDATE_FRAG_DIST_KEY_ORD" }
,{ GSN_DICT_COMMIT_REQ, "DICT_COMMIT_REQ"}
+
+ ,{ GSN_ROUTE_ORD, "ROUTE_ORD" }
};
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
diff --git a/storage/ndb/src/common/util/NdbSqlUtil.cpp b/storage/ndb/src/common/util/NdbSqlUtil.cpp
index f3d70a5734a..ba451c4dd8b 100644
--- a/storage/ndb/src/common/util/NdbSqlUtil.cpp
+++ b/storage/ndb/src/common/util/NdbSqlUtil.cpp
@@ -136,7 +136,7 @@ NdbSqlUtil::m_typeList[] = {
},
{ // 22
Type::Bit,
- NULL,
+ cmpBit,
NULL
},
{ // 23
@@ -679,6 +679,17 @@ NdbSqlUtil::cmpText(const void* info, const void* p1, unsigned n1, const void* p
}
int
+NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
+{
+ Uint32 n = (n1 < n2) ? n1 : n2;
+ char* c1 = (char*)p1;
+ char* c2 = (char*)p2;
+ int ret = memcmp(p1, p2, n);
+ return ret;
+}
+
+
+int
NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
{
if (n2 >= 3) {
@@ -698,12 +709,6 @@ NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p
}
// not yet
-int
-NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
-{
- assert(false);
- return 0;
-}
int
NdbSqlUtil::cmpLongvarchar(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
index 119f77fd0e2..56b5b8e4bc8 100644
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
@@ -6,7 +6,7 @@ Next DBTUP 4024
Next DBLQH 5045
Next DBDICT 6007
Next DBDIH 7178
-Next DBTC 8038
+Next DBTC 8039
Next CMVMI 9000
Next BACKUP 10036
Next DBUTIL 11002
@@ -21,6 +21,9 @@ Crash president when he starts to run in ArbitState 1-9.
910: Crash new president after node crash
+934 : Crash president in ALLOC_NODE_ID_REQ
+
+
ERROR CODES FOR TESTING NODE FAILURE, GLOBAL CHECKPOINT HANDLING:
-----------------------------------------------------------------
@@ -287,6 +290,11 @@ ABORT OF TCKEYREQ
8037 : Invalid schema version in TCINDXREQ
+------
+
+8038 : Simulate API disconnect just after SCAN_TAB_REQ
+
+
CMVMI
-----
9000 Set RestartOnErrorInsert to restart -n
diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index ec063b84022..57cf3f6bbf6 100644
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -92,6 +92,7 @@ Cmvmi::Cmvmi(Block_context& ctx) :
addRecSignal(GSN_DUMP_STATE_ORD, &Cmvmi::execDUMP_STATE_ORD);
addRecSignal(GSN_TESTSIG, &Cmvmi::execTESTSIG);
+ addRecSignal(GSN_NODE_START_REP, &Cmvmi::execNODE_START_REP, true);
subscriberPool.setSize(5);
@@ -367,6 +368,16 @@ void Cmvmi::execSTTOR(Signal* signal)
jamEntry();
if (theStartPhase == 1){
jam();
+
+ if(m_ctx.m_config.lockPagesInMainMemory())
+ {
+ int res = NdbMem_MemLockAll();
+ if(res != 0){
+ g_eventLogger.warning("Failed to memlock pages");
+ warningEvent("Failed to memlock pages");
+ }
+ }
+
sendSTTORRY(signal);
return;
} else if (theStartPhase == 3) {
@@ -383,18 +394,6 @@ void Cmvmi::execSTTOR(Signal* signal)
execOPEN_COMREQ(signal);
globalData.theStartLevel = NodeState::SL_STARTED;
sendSTTORRY(signal);
- } else {
- jam();
-
- if(m_ctx.m_config.lockPagesInMainMemory()){
- int res = NdbMem_MemLockAll();
- if(res != 0){
- g_eventLogger.warning("Failed to memlock pages");
- warningEvent("Failed to memlock pages");
- }
- }
-
- sendSTTORRY(signal);
}
}
@@ -448,7 +447,8 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
if(len == 2){
#ifdef ERROR_INSERT
- if (! (ERROR_INSERTED(9000) && c_error_9000_nodes_mask.get(tStartingNode)))
+ if (! ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002))
+ && c_error_9000_nodes_mask.get(tStartingNode)))
#endif
{
globalTransporterRegistry.do_connect(tStartingNode);
@@ -469,7 +469,8 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
jam();
#ifdef ERROR_INSERT
- if (ERROR_INSERTED(9000) && c_error_9000_nodes_mask.get(i))
+ if ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002))
+ && c_error_9000_nodes_mask.get(i))
continue;
#endif
@@ -578,6 +579,7 @@ void Cmvmi::execCONNECT_REP(Signal *signal){
/**
* Dont allow api nodes to connect
*/
+ ndbout_c("%d %d %d", hostId, type, globalData.theStartLevel);
abort();
globalTransporterRegistry.do_disconnect(hostId);
}
@@ -1199,9 +1201,9 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
}
#ifdef ERROR_INSERT
- if (arg == 9000)
+ if (arg == 9000 || arg == 9002)
{
- SET_ERROR_INSERT_VALUE(9000);
+ SET_ERROR_INSERT_VALUE(arg);
for (Uint32 i = 1; i<signal->getLength(); i++)
c_error_9000_nodes_mask.set(signal->theData[i]);
}
@@ -1209,13 +1211,16 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
if (arg == 9001)
{
CLEAR_ERROR_INSERT_VALUE;
- for (Uint32 i = 0; i<MAX_NODES; i++)
+ if (signal->getLength() == 1 || signal->theData[1])
{
- if (c_error_9000_nodes_mask.get(i))
+ for (Uint32 i = 0; i<MAX_NODES; i++)
{
- signal->theData[0] = 0;
- signal->theData[1] = i;
- EXECUTE_DIRECT(CMVMI, GSN_OPEN_COMREQ, signal, 2);
+ if (c_error_9000_nodes_mask.get(i))
+ {
+ signal->theData[0] = 0;
+ signal->theData[1] = i;
+ EXECUTE_DIRECT(CMVMI, GSN_OPEN_COMREQ, signal, 2);
+ }
}
}
c_error_9000_nodes_mask.clear();
@@ -1248,6 +1253,17 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
#endif
}//Cmvmi::execDUMP_STATE_ORD()
+void
+Cmvmi::execNODE_START_REP(Signal* signal)
+{
+#ifdef ERROR_INSERT
+ if (ERROR_INSERTED(9002) && signal->theData[0] == getOwnNodeId())
+ {
+ signal->theData[0] = 9001;
+ execDUMP_STATE_ORD(signal);
+ }
+#endif
+}
BLOCK_FUNCTIONS(Cmvmi)
diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
index 891ecc9610d..ed00b9ffd94 100644
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
@@ -72,7 +72,8 @@ private:
void handleSET_VAR_REQ(Signal* signal);
void execTESTSIG(Signal* signal);
-
+ void execNODE_START_REP(Signal* signal);
+
char theErrorMessage[256];
void sendSTTORRY(Signal* signal);
diff --git a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
index ff05aac0b9b..3f38d1cb264 100644
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
@@ -3337,9 +3337,10 @@ Dbacc::getElement(Signal* signal, OperationrecPtr& lockOwnerPtr)
bool found;
if (! searchLocalKey)
{
- Uint32 len = readTablePk(localkey1, tgeElementptr, lockOwnerPtr.p);
+ Uint32 len = readTablePk(localkey1, tgeElementHeader,
+ lockOwnerPtr.p);
found = (len == operationRecPtr.p->xfrmtupkeylen) &&
- (memcmp(Tkeydata, ckeys, len << 2) == 0);
+ (memcmp(Tkeydata, ckeys, len << 2) == 0);
} else {
jam();
found = (localkey1 == Tkeydata[0]);
diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
index 3edaf146cd4..37eb54028a6 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
@@ -1617,7 +1617,7 @@ private:
void dump_replica_info();
// 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/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
index 468a52f23f5..f448123531e 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
@@ -256,7 +256,8 @@ Dbdih::Dbdih(Block_context& ctx):
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, true);
+
addRecSignal(GSN_START_FRAGREF,
&Dbdih::execSTART_FRAGREF);
diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index 1eee1badce3..396d4417865 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -1421,7 +1421,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/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
index 736134a8a8b..cb415a97f0f 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
@@ -240,6 +240,7 @@ class Dbtup;
#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 */
@@ -2240,6 +2241,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, Operation_t);
diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index 53d7d98ae84..d814f30afac 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -62,6 +62,7 @@
#include <signaldata/KeyInfo.hpp>
#include <signaldata/AttrInfo.hpp>
#include <KeyDescriptor.hpp>
+#include <signaldata/RouteOrd.hpp>
// Use DEBUG to print messages that should be
// seen only when we debug the product
@@ -448,6 +449,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;
@@ -2216,7 +2233,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();
@@ -7273,8 +7290,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
@@ -7309,6 +7325,48 @@ 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
+ {
+ if (routeRef &&
+ getNodeInfo(refToNode(routeRef)).m_version >= MAKE_VERSION(5,1,14))
+ {
+ jam();
+ memmove(signal->theData+25, signal->theData, 4*TcKeyRef::SignalLength);
+ RouteOrd* ord = (RouteOrd*)signal->getDataPtrSend();
+ ord->dstRef = ref;
+ ord->srcRef = reference();
+ ord->gsn = GSN_TCKEYREF;
+ ord->cnt = 0;
+ LinearSectionPtr ptr[3];
+ ptr[0].p = signal->theData+25;
+ ptr[0].sz = TcKeyRef::SignalLength;
+ sendSignal(routeRef, GSN_ROUTE_ORD, signal, RouteOrd::SignalLength, JBB,
+ ptr, 1);
+ }
+ 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/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
index 6091b8f1aee..52c082a5623 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
@@ -1285,7 +1285,7 @@ private:
void execLQHKEYREF(Signal* signal);
void execTRANSID_AI_R(Signal* signal);
void execKEYINFO20_R(Signal* signal);
-
+ void execROUTE_ORD(Signal* signal);
// Received signals
void execDUMP_STATE_ORD(Signal* signal);
void execSEND_PACKED(Signal* signal);
diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
index 8dee75398ed..a0a14f5b13e 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
@@ -279,7 +279,8 @@ Dbtc::Dbtc(Block_context& ctx):
addRecSignal(GSN_WAIT_DROP_TAB_CONF, &Dbtc::execWAIT_DROP_TAB_CONF);
addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ);
-
+ addRecSignal(GSN_ROUTE_ORD, &Dbtc::execROUTE_ORD);
+
cacheRecord = 0;
apiConnectRecord = 0;
tcConnectRecord = 0;
diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index af2925fa738..ce606b14620 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -72,6 +72,8 @@
#include <NdbOut.hpp>
#include <DebuggerNames.hpp>
+#include <signaldata/RouteOrd.hpp>
+
// Use DEBUG to print messages that should be
// seen only when we debug the product
#ifdef VM_TRACE
@@ -8712,6 +8714,20 @@ void Dbtc::execSCAN_TABREQ(Signal* signal)
* IF ANY TO RECEIVE.
**********************************************************/
scanptr.p->scanState = ScanRecord::WAIT_AI;
+
+ if (ERROR_INSERTED(8038))
+ {
+ /**
+ * Force API_FAILREQ
+ */
+ DisconnectRep * const rep = (DisconnectRep *)signal->getDataPtrSend();
+ rep->nodeId = refToNode(apiConnectptr.p->ndbapiBlockref);
+ rep->err = 8038;
+
+ EXECUTE_DIRECT(CMVMI, GSN_DISCONNECT_REP, signal, 2);
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+
return;
SCAN_error_check:
@@ -8802,6 +8818,7 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr,
jam();
ScanFragRecPtr ptr;
ndbrequire(list.seize(ptr));
+ ptr.p->scanFragState = ScanFragRec::IDLE;
ptr.p->scanRec = scanptr.i;
ptr.p->scanFragId = 0;
ptr.p->m_apiPtr = cdata[i];
@@ -9599,9 +9616,17 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){
ScanRecord* scanP = scanPtr.p;
ndbrequire(scanPtr.p->scanState != ScanRecord::IDLE);
+ ScanRecord::ScanState old = scanPtr.p->scanState;
scanPtr.p->scanState = ScanRecord::CLOSING_SCAN;
scanPtr.p->m_close_scan_req = req_received;
+ if (old == ScanRecord::WAIT_FRAGMENT_COUNT)
+ {
+ jam();
+ scanPtr.p->scanState = old;
+ return; // Will continue on execDI_FCOUNTCONF
+ }
+
/**
* Queue : Action
* ============= : =================
@@ -9629,11 +9654,22 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){
ScanFragRecPtr curr = ptr; // Remove while iterating...
running.next(ptr);
- if(curr.p->scanFragState == ScanFragRec::WAIT_GET_PRIMCONF){
+ switch(curr.p->scanFragState){
+ case ScanFragRec::IDLE:
+ jam(); // real early abort
+ ndbrequire(old == ScanRecord::WAIT_AI);
+ running.release(curr);
+ continue;
+ case ScanFragRec::WAIT_GET_PRIMCONF:
jam();
continue;
+ case ScanFragRec::LQH_ACTIVE:
+ jam();
+ break;
+ default:
+ jamLine(curr.p->scanFragState);
+ ndbrequire(false);
}
- ndbrequire(curr.p->scanFragState == ScanFragRec::LQH_ACTIVE);
curr.p->startFragTimer(ctcTimer);
curr.p->scanFragState = ScanFragRec::LQH_ACTIVE;
@@ -13277,3 +13313,56 @@ Dbtc::TableRecord::getErrorCode(Uint32 schemaVersion) const {
return 0;
}
+void
+Dbtc::execROUTE_ORD(Signal* signal)
+{
+ jamEntry();
+ if(!assembleFragments(signal)){
+ jam();
+ return;
+ }
+
+ RouteOrd* ord = (RouteOrd*)signal->getDataPtr();
+ Uint32 dstRef = ord->dstRef;
+ Uint32 srcRef = ord->srcRef;
+ Uint32 gsn = ord->gsn;
+ Uint32 cnt = ord->cnt;
+
+ if (likely(getNodeInfo(refToNode(dstRef)).m_connected))
+ {
+ jam();
+ Uint32 secCount = signal->getNoOfSections();
+ SegmentedSectionPtr ptr[3];
+ ndbrequire(secCount >= 1 && secCount <= 3);
+
+ jamLine(secCount);
+ for (Uint32 i = 0; i<secCount; i++)
+ signal->getSection(ptr[i], i);
+
+ /**
+ * Put section 0 in signal->theData
+ */
+ ndbrequire(ptr[0].sz <= 25);
+ copy(signal->theData, ptr[0]);
+
+ signal->header.m_noOfSections = 0;
+
+ /**
+ * Shift rest of sections
+ */
+ for(Uint32 i = 1; i<secCount; i++)
+ {
+ signal->setSection(ptr[i], i - 1);
+ }
+
+ sendSignal(dstRef, gsn, signal, ptr[0].sz, JBB);
+
+ signal->header.m_noOfSections = 0;
+ signal->setSection(ptr[0], 0);
+ releaseSections(signal);
+ return ;
+ }
+
+ warningEvent("Unable to route GSN: %d from %x to %x",
+ gsn, srcRef, dstRef);
+}
diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
index e19e43f6d47..07ee55fce20 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
@@ -172,6 +172,7 @@ inline const Uint32* ALIGN_WORD(const void* ptr)
#define ZTRY_TO_UPDATE_ERROR 888
#define ZCALL_ERROR 890
#define ZTEMPORARY_RESOURCE_FAILURE 891
+#define ZUNSUPPORTED_BRANCH 892
#define ZSTORED_SEIZE_ATTRINBUFREC_ERROR 873 // Part of Scan
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
index 76f4c215618..31573f17079 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
@@ -320,6 +320,10 @@ int Dbtup::TUPKEY_abort(Signal* signal, int error_type)
ndbrequire(false);
}//if
break;
+ case 40:
+ ljam();
+ terrorCode = ZUNSUPPORTED_BRANCH;
+ break;
default:
ndbrequire(false);
break;
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index d24483b8f1d..9617bc8bdd0 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -2245,6 +2245,11 @@ int Dbtup::interpreterNextLab(Signal* signal,
// NULL==NULL and NULL<not-NULL
res1 = r1_null && r2_null ? 0 : r1_null ? -1 : 1;
} else {
+ jam();
+ if (unlikely(sqlType.m_cmp == 0))
+ {
+ return TUPKEY_abort(signal, 40);
+ }
res1 = (*sqlType.m_cmp)(cs, s1, attrLen, s2, argLen, true);
}
} else {
@@ -2252,6 +2257,11 @@ int Dbtup::interpreterNextLab(Signal* signal,
// NULL like NULL is true (has no practical use)
res1 = r1_null && r2_null ? 0 : -1;
} else {
+ jam();
+ if (unlikely(sqlType.m_like == 0))
+ {
+ return TUPKEY_abort(signal, 40);
+ }
res1 = (*sqlType.m_like)(cs, s1, attrLen, s2, argLen);
}
}
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index 0ae23083626..66bfd6fda55 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -329,6 +329,7 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
ScanOpPtr lcp;
ndbrequire(c_scanOpPool.seize(lcp));
+ new (lcp.p) ScanOp();
c_lcp_scan_op= lcp.i;
czero = 0;
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
index 3ebfbd4aaa9..38156d1453c 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
@@ -87,6 +87,7 @@ Dbtup::execACC_SCANREQ(Signal* signal)
ndbrequire(frag.m_lcp_scan_op == c_lcp_scan_op);
c_scanOpPool.getPtr(scanPtr, frag.m_lcp_scan_op);
+ ndbrequire(scanPtr.p->m_fragPtrI == fragPtr.i);
bits |= ScanOp::SCAN_LCP;
if (tablePtr.p->m_attributes[MM].m_no_of_varsize > 0) {
bits |= ScanOp::SCAN_VS;
@@ -1038,6 +1039,7 @@ Dbtup::releaseScanOp(ScanOpPtr& scanPtr)
{
ndbrequire(fragPtr.p->m_lcp_scan_op == scanPtr.i);
fragPtr.p->m_lcp_scan_op = RNIL;
+ scanPtr.p->m_fragPtrI = RNIL;
}
}
@@ -1064,8 +1066,9 @@ Dbtup::execLCP_FRAG_ORD(Signal* signal)
frag.m_lcp_scan_op = c_lcp_scan_op;
ScanOpPtr scanPtr;
c_scanOpPool.getPtr(scanPtr, frag.m_lcp_scan_op);
- //ndbrequire(scanPtr.p->m_fragPtrI == fragPtr.i); ?
-
+ ndbrequire(scanPtr.p->m_fragPtrI == RNIL);
+ scanPtr.p->m_fragPtrI = fragPtr.i;
+
scanFirst(signal, scanPtr);
scanPtr.p->m_state = ScanOp::First;
}
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
index 0e1b251d8a5..3df9b8ec7c5 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
@@ -833,6 +833,15 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr,
//--------------------------------------------------------------------
// Read Primary Key Values
//--------------------------------------------------------------------
+ Tuple_header *save0= req_struct->m_tuple_ptr;
+ if (regOperPtr->op_struct.op_type == ZDELETE &&
+ !regOperPtr->is_first_operation())
+ {
+ jam();
+ req_struct->m_tuple_ptr= (Tuple_header*)
+ c_undo_buffer.get_ptr(&req_struct->prevOpPtr.p->m_copy_tuple_location);
+ }
+
if (regTabPtr->need_expand())
prepare_read(req_struct, regTabPtr, true);
@@ -844,6 +853,9 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr,
false);
ndbrequire(ret != -1);
noPrimKey= ret;
+
+ req_struct->m_tuple_ptr = save0;
+
Uint32 numAttrsToRead;
if ((regOperPtr->op_struct.op_type == ZUPDATE) &&
(trigPtr->sendOnlyChangedAttributes)) {
diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 7be0943be5d..e725e5cb6a6 100644
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -4833,6 +4833,11 @@ Qmgr::execALLOC_NODEID_REQ(Signal * signal)
return;
}
+ if (ERROR_INSERTED(934) && nodeId != getOwnNodeId())
+ {
+ CRASH_INSERTION(934);
+ }
+
opAllocNodeIdReq.m_req = *req;
opAllocNodeIdReq.m_error = 0;
opAllocNodeIdReq.m_connectCount = getNodeInfo(refToNode(senderRef)).m_connectCount;
diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
index 6611ba36a60..d535512f79d 100644
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -931,15 +931,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)
-{
}
void
diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
index 2e8f33bf023..46fe03de98e 100644
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -446,7 +446,6 @@ private:
void execCONTINUE_FRAGMENTED(Signal* signal);
void execAPI_START_REP(Signal* signal);
void execNODE_START_REP(Signal* signal);
- virtual void exec_node_start_rep(Signal* signal);
Uint32 c_fragmentIdCounter;
ArrayPool<FragmentInfo> c_fragmentInfoPool;
diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp
index 47204ff6b51..44316b4f9c0 100644
--- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -119,7 +119,7 @@ public:
int executeStatus(int processId, const char* parameters, bool all);
int executeEventReporting(int processId, const char* parameters, bool all);
int executeDumpState(int processId, const char* parameters, bool all);
- int executeStartBackup(char * parameters);
+ int executeStartBackup(char * parameters, bool interactive);
int executeAbortBackup(char * parameters);
int executeStop(Vector<BaseString> &command_list, unsigned command_pos,
int *node_ids, int no_of_nodes);
@@ -991,7 +991,7 @@ CommandInterpreter::execute_impl(const char *_line, bool interactive)
else if(strcasecmp(firstToken, "START") == 0 &&
allAfterFirstToken != NULL &&
strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){
- m_error= executeStartBackup(allAfterFirstToken);
+ m_error= executeStartBackup(allAfterFirstToken, interactive);
DBUG_RETURN(true);
}
else if(strcasecmp(firstToken, "ABORT") == 0 &&
@@ -2452,24 +2452,17 @@ CommandInterpreter::executeEventReporting(int processId,
return retval;
}
+
/*****************************************************************************
* Backup
*****************************************************************************/
int
-CommandInterpreter::executeStartBackup(char* parameters)
+CommandInterpreter::executeStartBackup(char* parameters, bool interactive)
{
struct ndb_mgm_reply reply;
unsigned int backupId;
-#if 0
- int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
- int fd = ndb_mgm_listen_event(m_mgmsrv, filter);
- if (fd < 0)
- {
- ndbout << "Initializing start of backup failed" << endl;
- printError();
- return fd;
- }
-#endif
+ int fd = -1;
+
Vector<BaseString> args;
{
BaseString(parameters).split(args);
@@ -2482,25 +2475,21 @@ CommandInterpreter::executeStartBackup(char* parameters)
int sz= args.size();
int result;
- if (sz == 2 &&
- args[1] == "NOWAIT")
+ int flags = 2;
+ if (sz == 2 && args[1] == "NOWAIT")
{
+ flags = 0;
result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply);
}
- else if (sz == 1 ||
- (sz == 3 &&
- args[1] == "WAIT" &&
- args[2] == "COMPLETED"))
+ else if (sz == 1 || (sz == 3 && args[1] == "WAIT" && args[2] == "COMPLETED"))
{
+ flags = 2;
ndbout_c("Waiting for completed, this may take several minutes");
- result = ndb_mgm_start_backup(m_mgmsrv, 2, &backupId, &reply);
}
- else if (sz == 3 &&
- args[1] == "WAIT" &&
- args[2] == "STARTED")
+ else if (sz == 3 && args[1] == "WAIT" && args[2] == "STARTED")
{
ndbout_c("Waiting for started, this may take several minutes");
- result = ndb_mgm_start_backup(m_mgmsrv, 1, &backupId, &reply);
+ flags = 1;
}
else
{
@@ -2508,45 +2497,63 @@ CommandInterpreter::executeStartBackup(char* parameters)
return -1;
}
+ /**
+ * If interactive...event listner is already running
+ */
+ if (flags == 2 && !interactive)
+ {
+ int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0, 0 };
+ fd = ndb_mgm_listen_event(m_mgmsrv, filter);
+ if (fd < 0)
+ {
+ ndbout << "Initializing start of backup failed" << endl;
+ printError();
+ return fd;
+ }
+ }
+ result = ndb_mgm_start_backup(m_mgmsrv, flags, &backupId, &reply);
+
if (result != 0) {
ndbout << "Backup failed" << endl;
printError();
-#if 0
- close(fd);
-#endif
+
+ if (fd >= 0)
+ close(fd);
return result;
}
-#if 0
- ndbout_c("Waiting for completed, this may take several minutes");
- char *tmp;
- char buf[1024];
+
+ if (fd >= 0)
{
- SocketInputStream in(fd);
- int count = 0;
+ char *tmp;
+ char buf[1024];
+ {
+ SocketInputStream in(fd);
+ int count = 0;
+ do {
+ tmp = in.gets(buf, 1024);
+ if(tmp)
+ {
+ ndbout << tmp;
+ unsigned int id;
+ if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){
+ count++;
+ }
+ }
+ } while(count < 2);
+ }
+
+ SocketInputStream in(fd, 10);
do {
tmp = in.gets(buf, 1024);
- if(tmp)
+ if(tmp && tmp[0] != 0)
{
ndbout << tmp;
- unsigned int id;
- if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){
- count++;
- }
}
- } while(count < 2);
+ } while(tmp && tmp[0] != 0);
+
+ close(fd);
}
- SocketInputStream in(fd, 10);
- do {
- tmp = in.gets(buf, 1024);
- if(tmp && tmp[0] != 0)
- {
- ndbout << tmp;
- }
- } while(tmp && tmp[0] != 0);
-
- close(fd);
-#endif
return 0;
}
diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
index 58369141ba3..29b1daf2e2a 100644
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -972,6 +972,15 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
StopReq* const stopReq = CAST_PTR(StopReq, ssig.getDataPtrSend());
ssig.set(ss, TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, StopReq::SignalLength);
+ NdbNodeBitmask notstarted;
+ for (Uint32 i = 0; i<node_ids.size(); i++)
+ {
+ Uint32 nodeId = node_ids[i];
+ ClusterMgr::Node node = theFacade->theClusterMgr->getNodeInfo(nodeId);
+ if (node.m_state.startLevel != NodeState::SL_STARTED)
+ notstarted.set(nodeId);
+ }
+
stopReq->requestInfo = 0;
stopReq->apiTimeout = 5000;
stopReq->transactionTimeout = 1000;
@@ -1142,6 +1151,14 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
case GSN_NODE_FAILREP:{
const NodeFailRep * const rep =
CAST_CONSTPTR(NodeFailRep, signal->getDataPtr());
+ NdbNodeBitmask mask;
+ char buf[100];
+ mask.assign(NdbNodeBitmask::Size, rep->theNodes);
+ mask.bitAND(notstarted);
+ nodes.bitANDC(mask);
+
+ if (singleUserNodeId == 0)
+ stoppedNodes.bitOR(mask);
break;
}
default:
@@ -2051,7 +2068,10 @@ MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type)
ndbout_c("Node %d fail completed", rep->failedNodeId);
#endif
if (rep->failedNodeId == nodeId)
+ {
+ do_send = 1;
nodeId = 0;
+ }
continue;
}
case GSN_NODE_FAILREP:{
diff --git a/storage/ndb/src/ndbapi/NdbTransaction.cpp b/storage/ndb/src/ndbapi/NdbTransaction.cpp
index 0c59746c1e9..538b6d645d1 100644
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp
@@ -926,7 +926,10 @@ NdbTransaction::release(){
* The user did not perform any rollback but simply closed the
* transaction. We must rollback Ndb since Ndb have been contacted.
************************************************************************/
- execute(Rollback);
+ if (!theSimpleState)
+ {
+ execute(Rollback);
+ }
}//if
theMagicNumber = 0xFE11DC;
theInUseState = false;
@@ -1970,8 +1973,10 @@ NdbTransaction::receiveTCINDXCONF(const TcIndxConf * indxConf,
if (tCommitFlag == 1) {
theCommitStatus = Committed;
theGlobalCheckpointId = tGCI;
- assert(tGCI);
- *p_latest_trans_gci = tGCI;
+ if (tGCI) // Read(dirty) only transaction doesnt get GCI
+ {
+ *p_latest_trans_gci = tGCI;
+ }
} else if ((tNoComp >= tNoSent) &&
(theLastExecOpInList->theCommitIndicator == 1)){
/**********************************************************************/
diff --git a/storage/ndb/src/ndbapi/SignalSender.cpp b/storage/ndb/src/ndbapi/SignalSender.cpp
index 0ecc98f5f29..86ce3b82672 100644
--- a/storage/ndb/src/ndbapi/SignalSender.cpp
+++ b/storage/ndb/src/ndbapi/SignalSender.cpp
@@ -131,15 +131,6 @@ SignalSender::getNoOfConnectedNodes() const {
return theFacade->theClusterMgr->getNoOfConnectedNodes();
}
-SendStatus
-SignalSender::sendSignal(Uint16 nodeId, const SimpleSignal * s){
- return theFacade->theTransporterRegistry->prepareSend(&s->header,
- 1, // JBB
- &s->theData[0],
- nodeId,
- &s->ptr[0]);
-}
-
template<class T>
SimpleSignal *
SignalSender::waitFor(Uint32 timeOutMillis, T & t)
diff --git a/storage/ndb/src/ndbapi/TransporterFacade.cpp b/storage/ndb/src/ndbapi/TransporterFacade.cpp
index 7bede292f5f..a2103c6107d 100644
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp
@@ -1512,3 +1512,28 @@ void PollGuard::unlock_and_signal()
template class Vector<NodeStatusFunction>;
template class Vector<TransporterFacade::ThreadData::Object_Execute>;
+
+#include "SignalSender.hpp"
+
+SendStatus
+SignalSender::sendSignal(Uint16 nodeId, const SimpleSignal * s){
+#ifdef API_TRACE
+ if(setSignalLog() && TRACE_GSN(s->header.theVerId_signalNumber)){
+ SignalHeader tmp = s->header;
+ tmp.theSendersBlockRef = getOwnRef();
+
+ LinearSectionPtr ptr[3];
+ signalLogger.sendSignal(tmp,
+ 1,
+ s->theData,
+ nodeId, ptr, 0);
+ signalLogger.flushSignalLog();
+ }
+#endif
+
+ return theFacade->theTransporterRegistry->prepareSend(&s->header,
+ 1, // JBB
+ &s->theData[0],
+ nodeId,
+ &s->ptr[0]);
+}
diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c
index 68c521e7b82..9466132066f 100644
--- a/storage/ndb/src/ndbapi/ndberror.c
+++ b/storage/ndb/src/ndbapi/ndberror.c
@@ -297,6 +297,7 @@ ErrorBundle ErrorCodes[] = {
{ 885, DMEC, AE, "Stack underflow in interpreter" },
{ 886, DMEC, AE, "More than 65535 instructions executed in interpreter" },
{ 897, DMEC, AE, "Update attempt of primary key via ndbcluster internal api (if this occurs via the MySQL server it is a bug, please report)" },
+ { 892, DMEC, AE, "Unsupported type in scan filter" },
{ 4256, DMEC, AE, "Must call Ndb::init() before this function" },
{ 4257, DMEC, AE, "Tried to read too much - too many getValue calls" },
diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp
index 444ed5c9eb4..d346a4f0057 100644
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp
@@ -23,6 +23,7 @@
#include <Vector.hpp>
#include <signaldata/DumpStateOrd.hpp>
#include <Bitmask.hpp>
+#include <RefConvert.hpp>
int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){
@@ -966,6 +967,72 @@ runBug21271(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
+int
+runBug24543(NDBT_Context* ctx, NDBT_Step* step){
+ NdbRestarter restarter;
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ if (restarter.dumpStateAllNodes(val2, 2))
+ return NDBT_FAILED;
+
+ int nodes[2];
+ nodes[0] = restarter.getMasterNodeId();
+ restarter.insertErrorInNode(nodes[0], 934);
+
+ nodes[1] = restarter.getRandomNodeOtherNodeGroup(nodes[0], rand());
+ if (nodes[1] == -1)
+ {
+ nodes[1] = restarter.getRandomNodeSameNodeGroup(nodes[0], rand());
+ }
+
+ restarter.restartOneDbNode(nodes[1], false, true, true);
+ if (restarter.waitNodesNoStart(nodes, 2))
+ return NDBT_FAILED;
+
+ restarter.startNodes(nodes, 2);
+ if (restarter.waitNodesStarted(nodes, 2))
+ {
+ return NDBT_FAILED;
+ }
+ return NDBT_OK;
+}
+int runBug24717(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+ Ndb* pNdb = GETNDB(step);
+
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ int dump[] = { 9000, 0 } ;
+ Uint32 ownNode = refToNode(pNdb->getReference());
+ dump[1] = ownNode;
+
+ for (; loops; loops --)
+ {
+ int nodeId = restarter.getRandomNotMasterNodeId(rand());
+ restarter.restartOneDbNode(nodeId, false, true, true);
+ restarter.waitNodesNoStart(&nodeId, 1);
+
+ if (restarter.dumpStateOneNode(nodeId, dump, 2))
+ return NDBT_FAILED;
+
+ restarter.startNodes(&nodeId, 1);
+
+ for (Uint32 i = 0; i < 100; i++)
+ {
+ hugoTrans.pkReadRecords(pNdb, 100, 1, NdbOperation::LM_CommittedRead);
+ }
+
+ int reset[2] = { 9001, 0 };
+ restarter.dumpStateOneNode(nodeId, reset, 2);
+ restarter.waitClusterStarted();
+ }
+
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
@@ -1279,6 +1346,10 @@ TESTCASE("Bug20185",
STEP(runBug20185);
FINALIZER(runClearTable);
}
+TESTCASE("Bug24543", "")
+{
+ INITIALIZER(runBug24543);
+}
TESTCASE("Bug21271",
""){
INITIALIZER(runLoadTable);
@@ -1286,6 +1357,9 @@ TESTCASE("Bug21271",
STEP(runPkUpdateUntilStopped);
FINALIZER(runClearTable);
}
+TESTCASE("Bug24717", ""){
+ INITIALIZER(runBug24717);
+}
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testScan.cpp b/storage/ndb/test/ndbapi/testScan.cpp
index 097454f69b2..43c843c9875 100644
--- a/storage/ndb/test/ndbapi/testScan.cpp
+++ b/storage/ndb/test/ndbapi/testScan.cpp
@@ -641,7 +641,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
int nodeId = restarter.getDbNodeId(lastId);
lastId = (lastId + 1) % restarter.getNumDbNodes();
- if(restarter.restartOneDbNode(nodeId) != 0){
+ if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){
g_err << "Failed to restartNextDbNode" << endl;
result = NDBT_FAILED;
break;
@@ -1220,7 +1220,39 @@ runScanVariants(NDBT_Context* ctx, NDBT_Step* step)
}
}
}
+ return NDBT_OK;
+}
+
+int
+runBug24447(NDBT_Context* ctx, NDBT_Step* step){
+ int loops = 1; //ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ int abort = ctx->getProperty("AbortProb", 15);
+ NdbRestarter restarter;
+ HugoTransactions hugoTrans(*ctx->getTab());
+ int i = 0;
+ while (i<loops && !ctx->isTestStopped())
+ {
+ g_info << i++ << ": ";
+
+ int nodeId = restarter.getRandomNotMasterNodeId(rand());
+ if (nodeId == -1)
+ nodeId = restarter.getMasterNodeId();
+ if (restarter.insertErrorInNode(nodeId, 8038) != 0)
+ {
+ ndbout << "Could not insert error in node="<<nodeId<<endl;
+ return NDBT_FAILED;
+ }
+ for (Uint32 j = 0; i<10; i++)
+ {
+ hugoTrans.scanReadRecords(GETNDB(step), records, abort, 0,
+ NdbOperation::LM_CommittedRead);
+ }
+
+ }
+ restarter.insertErrorInAllNodes(0);
+
return NDBT_OK;
}
@@ -1708,6 +1740,12 @@ TESTCASE("ScanVariants",
STEP(runScanVariants);
FINALIZER(runClearTable);
}
+TESTCASE("Bug24447",
+ ""){
+ INITIALIZER(runLoadTable);
+ STEP(runBug24447);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testScan);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt
index 786f74cade4..ba4d9ece8d4 100644
--- a/storage/ndb/test/run-test/daily-basic-tests.txt
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt
@@ -451,6 +451,10 @@ args: -n ScanParallelism
max-time: 500
cmd: testScan
+args: -n Bug24447 T1
+
+max-time: 500
+cmd: testScan
args: -n ScanVariants
max-time: 500
@@ -497,6 +501,10 @@ max-time: 1000
cmd: testIndex
args: -n Bug21384
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug24717 T1
+
#
# DICT TESTS
max-time: 1500
@@ -740,6 +748,10 @@ max-time: 1000
cmd: testSRBank
args: -n Mix -l 300 -r 15 T1
+max-time: 300
+cmd: testNodeRestart
+args: -n Bug24543 T1
+
# OLD FLEX
max-time: 500
cmd: flexBench