summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi/Ndb.cpp
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-02-10 18:38:13 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2005-02-10 18:38:13 +0100
commitff51bed8d1c1a7df6876bc86b3a15d4249e08136 (patch)
treef9bfea598aa3983661b18808e213c52085012ec0 /ndb/src/ndbapi/Ndb.cpp
parente66abffa02c58902d0efabfc6c86458aca4ec3dc (diff)
downloadmariadb-git-ff51bed8d1c1a7df6876bc86b3a15d4249e08136.tar.gz
added more debug trace
+ removed double check for invalid socket ndb/src/common/transporter/Transporter.cpp: added more debug trace + removed double check for invalid socket ndb/src/ndbapi/Ndb.cpp: added more debug trace
Diffstat (limited to 'ndb/src/ndbapi/Ndb.cpp')
-rw-r--r--ndb/src/ndbapi/Ndb.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index e7b36d6ee02..59d1e45ca46 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -49,13 +49,15 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
Uint32 tAnyAlive = 0;
int TretCode= 0;
+ DBUG_ENTER("Ndb::doConnect");
+
if (tConNode != 0) {
TretCode = NDB_connect(tConNode);
if ((TretCode == 1) || (TretCode == 2)) {
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
- return getConnectedNdbTransaction(tConNode);
+ DBUG_RETURN(getConnectedNdbTransaction(tConNode));
} else if (TretCode != 0) {
tAnyAlive = 1;
}//if
@@ -78,10 +80,11 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
- return getConnectedNdbTransaction(tNode);
+ DBUG_RETURN(getConnectedNdbTransaction(tNode));
} else if (TretCode != 0) {
tAnyAlive= 1;
}//if
+ DBUG_PRINT("info",("tried node %d TretCode %d", tNode, TretCode));
}
}
else // just do a regular round robin
@@ -103,10 +106,11 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
- return getConnectedNdbTransaction(tNode);
+ DBUG_RETURN(getConnectedNdbTransaction(tNode));
} else if (TretCode != 0) {
tAnyAlive= 1;
}//if
+ DBUG_PRINT("info",("tried node %d TretCode %d", tNode, TretCode));
} while (Tcount < tNoOfDbNodes);
}
//****************************************************************************
@@ -121,7 +125,7 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
} else {
theError.code = 4009;
}//if
- return NULL;
+ DBUG_RETURN(NULL);
}
int
@@ -134,29 +138,31 @@ Ndb::NDB_connect(Uint32 tNode)
int tReturnCode;
TransporterFacade *tp = TransporterFacade::instance();
+ DBUG_ENTER("Ndb::NDB_connect");
+
bool nodeAvail = tp->get_node_alive(tNode);
if(nodeAvail == false){
- return 0;
+ DBUG_RETURN(0);
}
NdbTransaction * tConArray = theConnectionArray[tNode];
if (tConArray != NULL) {
- return 2;
+ DBUG_RETURN(2);
}
NdbTransaction * tNdbCon = getNdbCon(); // Get free connection object.
if (tNdbCon == NULL) {
- return 4;
+ DBUG_RETURN(4);
}//if
NdbApiSignal* tSignal = getSignal(); // Get signal object
if (tSignal == NULL) {
releaseNdbCon(tNdbCon);
- return 4;
+ DBUG_RETURN(4);
}//if
if (tSignal->setSignal(GSN_TCSEIZEREQ) == -1) {
releaseNdbCon(tNdbCon);
releaseSignal(tSignal);
- return 4;
+ DBUG_RETURN(4);
}//if
tSignal->setData(tNdbCon->ptr2int(), 1);
//************************************************
@@ -192,13 +198,16 @@ Ndb::NDB_connect(Uint32 tNode)
tNdbCon->setMyBlockReference(theMyRef);
theConnectionArray[tNode] = tNdbCon;
tNdbCon->theNext = tPrevFirst;
- return 1;
+ DBUG_RETURN(1);
} else {
releaseNdbCon(tNdbCon);
//****************************************************************************
// Unsuccessful connect is indicated by 3.
//****************************************************************************
- return 3;
+ DBUG_PRINT("info",
+ ("unsuccessful connect tReturnCode %d, tNdbCon->Status() %d",
+ tReturnCode, tNdbCon->Status()));
+ DBUG_RETURN(3);
}//if
}//Ndb::NDB_connect()