diff options
author | unknown <dli@dev3-76.dev.cn.tlan> | 2006-10-13 09:38:41 +0800 |
---|---|---|
committer | unknown <dli@dev3-76.dev.cn.tlan> | 2006-10-13 09:38:41 +0800 |
commit | 994ce8f209e1aebcb1fc4874119bebfd3bbd0013 (patch) | |
tree | a9a31c7a9fb77c4a1b3caa08bfcf5accc1706221 /storage/ndb | |
parent | 38edc8ad720dce9323347cff5c52ab83d73f556e (diff) | |
parent | 5edab966ee59eb5610d6b712d0df9b98ac46fd1a (diff) | |
download | mariadb-git-994ce8f209e1aebcb1fc4874119bebfd3bbd0013.tar.gz |
Merge dli@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into dev3-76.dev.cn.tlan:/home/dli/mysql/mysql-5.1/mysql-5.1-new-ndb-bj
Diffstat (limited to 'storage/ndb')
3 files changed, 32 insertions, 29 deletions
diff --git a/storage/ndb/src/common/transporter/OSE_Receiver.cpp b/storage/ndb/src/common/transporter/OSE_Receiver.cpp index 63a33fc8f24..cc82585cb25 100644 --- a/storage/ndb/src/common/transporter/OSE_Receiver.cpp +++ b/storage/ndb/src/common/transporter/OSE_Receiver.cpp @@ -114,11 +114,11 @@ OSE_Receiver::checkWaitStack(NodeId _nodeId){ if (waitStack[i]->dataSignal.senderNodeId == _nodeId && waitStack[i]->dataSignal.sigId == nextSigId[_nodeId]){ - ndbout_c("INFO: signal popped from waitStack, sigId = %d", + g_eventLogger.info("signal popped from waitStack, sigId = %d", waitStack[i]->dataSignal.sigId); if(isFull()){ - ndbout_c("ERROR: receiveBuffer is full"); + g_eventLogger.error("receiveBuffer is full"); reportError(callbackObj, _nodeId, TE_RECEIVE_BUFFER_FULL); return false; } @@ -172,7 +172,7 @@ OSE_Receiver::insertWaitStack(union SIGNAL* _sig){ waitStack[waitStackCount] = _sig; waitStackCount++; } else { - ndbout_c("ERROR: waitStack is full"); + g_eventLogger.error("waitStack is full"); reportError(callbackObj, localNodeId, TE_WAIT_STACK_FULL); } } @@ -231,14 +231,14 @@ OSE_Receiver::doReceive(Uint32 timeOutMillis) { } else { // Signal was not received in correct order // Check values and put it in the waitStack - ndbout_c("WARNING: sigId out of order," + g_eventLogger.warning("sigId out of order," " currSigId = %d, nextSigId = %d", currSigId, nextSigId[nodeId]); if (currSigId < nextSigId[nodeId]){ // Current recieved sigId was smaller than nextSigId // There is no use to put it in the waitStack - ndbout_c("ERROR: recieved sigId was smaller than nextSigId"); + g_eventLogger.error("recieved sigId was smaller than nextSigId"); reportError(callbackObj, nodeId, TE_TOO_SMALL_SIGID); return false; } @@ -246,7 +246,7 @@ OSE_Receiver::doReceive(Uint32 timeOutMillis) { if (currSigId > (nextSigId[nodeId] + waitStackSize)){ // Current sigId was larger than nextSigId + size of waitStack // we can never "save" so many signal's on the stack - ndbout_c("ERROR: currSigId > (nextSigId + size of waitStack)"); + g_eventLogger.error("currSigId > (nextSigId + size of waitStack)"); reportError(callbackObj, nodeId, TE_TOO_LARGE_SIGID); return false; } diff --git a/storage/ndb/src/common/transporter/TCP_Transporter.cpp b/storage/ndb/src/common/transporter/TCP_Transporter.cpp index 5db12d3985c..c347b813840 100644 --- a/storage/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/storage/ndb/src/common/transporter/TCP_Transporter.cpp @@ -20,6 +20,9 @@ #include "TCP_Transporter.hpp" #include <NdbOut.hpp> #include <NdbSleep.h> + +#include <EventLogger.hpp> +extern EventLogger g_eventLogger; // End of stuff to be moved #if defined NDB_OSE || defined NDB_SOFTOSE @@ -159,14 +162,14 @@ TCP_Transporter::setSocketOptions(){ if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF, (char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) { #ifdef DEBUG_TRANSPORTER - ndbout_c("The setsockopt SO_RCVBUF error code = %d", InetErrno); + g_eventLogger.error("The setsockopt SO_RCVBUF error code = %d", InetErrno); #endif }//if if (setsockopt(theSocket, SOL_SOCKET, SO_SNDBUF, (char*)&sockOptSndBufSize, sizeof(sockOptSndBufSize)) < 0) { #ifdef DEBUG_TRANSPORTER - ndbout_c("The setsockopt SO_SNDBUF error code = %d", InetErrno); + g_eventLogger.error("The setsockopt SO_SNDBUF error code = %d", InetErrno); #endif }//if @@ -177,7 +180,7 @@ TCP_Transporter::setSocketOptions(){ if (setsockopt(theSocket, IPPROTO_TCP, TCP_NODELAY, (char*)&sockOptNodelay, sizeof(sockOptNodelay)) < 0) { #ifdef DEBUG_TRANSPORTER - ndbout_c("The setsockopt TCP_NODELAY error code = %d", InetErrno); + g_eventLogger.error("The setsockopt TCP_NODELAY error code = %d", InetErrno); #endif }//if } @@ -191,7 +194,7 @@ TCP_Transporter::setSocketNonBlocking(NDB_SOCKET_TYPE socket){ if(ioctlsocket(socket, FIONBIO, &ul)) { #ifdef DEBUG_TRANSPORTER - ndbout_c("Set non-blocking server error3: %d", InetErrno); + g_eventLogger.error("Set non-blocking server error3: %d", InetErrno); #endif }//if return true; @@ -205,13 +208,13 @@ TCP_Transporter::setSocketNonBlocking(NDB_SOCKET_TYPE socket){ flags = fcntl(socket, F_GETFL, 0); if (flags < 0) { #ifdef DEBUG_TRANSPORTER - ndbout_c("Set non-blocking server error1: %s", strerror(InetErrno)); + g_eventLogger.error("Set non-blocking server error1: %s", strerror(InetErrno)); #endif }//if flags |= NDB_NONBLOCK; if (fcntl(socket, F_SETFL, flags) == -1) { #ifdef DEBUG_TRANSPORTER - ndbout_c("Set non-blocking server error2: %s", strerror(InetErrno)); + g_eventLogger.error("Set non-blocking server error2: %s", strerror(InetErrno)); #endif }//if return true; @@ -349,7 +352,7 @@ TCP_Transporter::doSend() { } else { // Send failed #if defined DEBUG_TRANSPORTER - ndbout_c("Send Failure(disconnect==%d) to node = %d nBytesSent = %d " + g_eventLogger.error("Send Failure(disconnect==%d) to node = %d nBytesSent = %d " "errno = %d strerror = %s", DISCONNECT_ERRNO(InetErrno, nBytesSent), remoteNodeId, nBytesSent, InetErrno, @@ -384,11 +387,11 @@ TCP_Transporter::doReceive() { if(receiveBuffer.sizeOfData > receiveBuffer.sizeOfBuffer){ #ifdef DEBUG_TRANSPORTER - ndbout_c("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)", + g_eventLogger.error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)", receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer); - ndbout_c("nBytesRead = %d", nBytesRead); + g_eventLogger.error("nBytesRead = %d", nBytesRead); #endif - ndbout_c("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)", + g_eventLogger.error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)", receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer); report_error(TE_INVALID_MESSAGE_LENGTH); return 0; @@ -405,7 +408,7 @@ TCP_Transporter::doReceive() { return nBytesRead; } else { #if defined DEBUG_TRANSPORTER - ndbout_c("Receive Failure(disconnect==%d) to node = %d nBytesSent = %d " + g_eventLogger.error("Receive Failure(disconnect==%d) to node = %d nBytesSent = %d " "errno = %d strerror = %s", DISCONNECT_ERRNO(InetErrno, nBytesRead), remoteNodeId, nBytesRead, InetErrno, diff --git a/storage/ndb/src/common/transporter/TransporterRegistry.cpp b/storage/ndb/src/common/transporter/TransporterRegistry.cpp index 4a0be702a86..395f69ede73 100644 --- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp @@ -891,7 +891,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis) tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout); if(false && tcpReadSelectReply == -1 && errno == EINTR) - ndbout_c("woke-up by signal"); + g_eventLogger.info("woke-up by signal"); #ifdef NDB_WIN32 if(tcpReadSelectReply == SOCKET_ERROR) @@ -1313,12 +1313,12 @@ TransporterRegistry::start_clients_thread() } else if(ndb_mgm_is_connected(m_mgm_handle)) { - ndbout_c("Failed to get dynamic port to connect to: %d", res); + g_eventLogger.info("Failed to get dynamic port to connect to: %d", res); ndb_mgm_disconnect(m_mgm_handle); } else { - ndbout_c("Management server closed connection early. " + g_eventLogger.info("Management server closed connection early. " "It is probably being shut down (or has problems). " "We will retry the connection."); } @@ -1416,7 +1416,7 @@ TransporterRegistry::start_service(SocketServer& socket_server) DBUG_ENTER("TransporterRegistry::start_service"); if (m_transporter_interface.size() > 0 && !nodeIdSpecified) { - ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified"); + g_eventLogger.error("TransporterRegistry::startReceiving: localNodeId not specified"); DBUG_RETURN(false); } @@ -1442,7 +1442,7 @@ TransporterRegistry::start_service(SocketServer& socket_server) * If it wasn't a dynamically allocated port, or * our attempts at getting a new dynamic port failed */ - ndbout_c("Unable to setup transporter service port: %s:%d!\n" + g_eventLogger.error("Unable to setup transporter service port: %s:%d!\n" "Please check if the port is already used,\n" "(perhaps the node is already running)", t.m_interface ? t.m_interface : "*", t.m_s_service_port); @@ -1575,13 +1575,13 @@ bool TransporterRegistry::connect_client(NdbMgmHandle *h) if(!mgm_nodeid) { - ndbout_c("%s: %d", __FILE__, __LINE__); + g_eventLogger.error("%s: %d", __FILE__, __LINE__); return false; } Transporter * t = theTransporters[mgm_nodeid]; if (!t) { - ndbout_c("%s: %d", __FILE__, __LINE__); + g_eventLogger.error("%s: %d", __FILE__, __LINE__); return false; } DBUG_RETURN(t->connect_client(connect_ndb_mgmd(h))); @@ -1597,7 +1597,7 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h) if ( h==NULL || *h == NULL ) { - ndbout_c("%s: %d", __FILE__, __LINE__); + g_eventLogger.error("%s: %d", __FILE__, __LINE__); return NDB_INVALID_SOCKET; } @@ -1610,10 +1610,10 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h) m_transporter_interface[i].m_s_service_port, &mgm_reply) < 0) { - ndbout_c("Error: %s: %d", + g_eventLogger.error("Error: %s: %d", ndb_mgm_get_latest_error_desc(*h), ndb_mgm_get_latest_error(*h)); - ndbout_c("%s: %d", __FILE__, __LINE__); + g_eventLogger.error("%s: %d", __FILE__, __LINE__); ndb_mgm_destroy_handle(h); return NDB_INVALID_SOCKET; } @@ -1625,10 +1625,10 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h) NDB_SOCKET_TYPE sockfd= ndb_mgm_convert_to_transporter(h); if ( sockfd == NDB_INVALID_SOCKET) { - ndbout_c("Error: %s: %d", + g_eventLogger.error("Error: %s: %d", ndb_mgm_get_latest_error_desc(*h), ndb_mgm_get_latest_error(*h)); - ndbout_c("%s: %d", __FILE__, __LINE__); + g_eventLogger.error("%s: %d", __FILE__, __LINE__); ndb_mgm_destroy_handle(h); } return sockfd; |