Commit 5edab966 authored by unknown's avatar unknown

fixed for BUG#21519, 'MySQLD Err msg "Management server closed connection"...

fixed for BUG#21519, 'MySQLD Err msg "Management server closed connection" needs date & time stamp'.
added date & time stamp for the messages that will be printed to the mysqld message file.


storage/ndb/src/common/transporter/OSE_Receiver.cpp:
  added date & time stamp for the messages.
storage/ndb/src/common/transporter/TCP_Transporter.cpp:
  added date & time stamp for the messages.
storage/ndb/src/common/transporter/TransporterRegistry.cpp:
  added date & time stamp for the messages.
parent e963a7cd
...@@ -114,11 +114,11 @@ OSE_Receiver::checkWaitStack(NodeId _nodeId){ ...@@ -114,11 +114,11 @@ OSE_Receiver::checkWaitStack(NodeId _nodeId){
if (waitStack[i]->dataSignal.senderNodeId == _nodeId && if (waitStack[i]->dataSignal.senderNodeId == _nodeId &&
waitStack[i]->dataSignal.sigId == nextSigId[_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); waitStack[i]->dataSignal.sigId);
if(isFull()){ if(isFull()){
ndbout_c("ERROR: receiveBuffer is full"); g_eventLogger.error("receiveBuffer is full");
reportError(callbackObj, _nodeId, TE_RECEIVE_BUFFER_FULL); reportError(callbackObj, _nodeId, TE_RECEIVE_BUFFER_FULL);
return false; return false;
} }
...@@ -172,7 +172,7 @@ OSE_Receiver::insertWaitStack(union SIGNAL* _sig){ ...@@ -172,7 +172,7 @@ OSE_Receiver::insertWaitStack(union SIGNAL* _sig){
waitStack[waitStackCount] = _sig; waitStack[waitStackCount] = _sig;
waitStackCount++; waitStackCount++;
} else { } else {
ndbout_c("ERROR: waitStack is full"); g_eventLogger.error("waitStack is full");
reportError(callbackObj, localNodeId, TE_WAIT_STACK_FULL); reportError(callbackObj, localNodeId, TE_WAIT_STACK_FULL);
} }
} }
...@@ -231,14 +231,14 @@ OSE_Receiver::doReceive(Uint32 timeOutMillis) { ...@@ -231,14 +231,14 @@ OSE_Receiver::doReceive(Uint32 timeOutMillis) {
} else { } else {
// Signal was not received in correct order // Signal was not received in correct order
// Check values and put it in the waitStack // 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 = %d, nextSigId = %d",
currSigId, nextSigId[nodeId]); currSigId, nextSigId[nodeId]);
if (currSigId < nextSigId[nodeId]){ if (currSigId < nextSigId[nodeId]){
// Current recieved sigId was smaller than nextSigId // Current recieved sigId was smaller than nextSigId
// There is no use to put it in the waitStack // 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); reportError(callbackObj, nodeId, TE_TOO_SMALL_SIGID);
return false; return false;
} }
...@@ -246,7 +246,7 @@ OSE_Receiver::doReceive(Uint32 timeOutMillis) { ...@@ -246,7 +246,7 @@ OSE_Receiver::doReceive(Uint32 timeOutMillis) {
if (currSigId > (nextSigId[nodeId] + waitStackSize)){ if (currSigId > (nextSigId[nodeId] + waitStackSize)){
// Current sigId was larger than nextSigId + size of waitStack // Current sigId was larger than nextSigId + size of waitStack
// we can never "save" so many signal's on the stack // 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); reportError(callbackObj, nodeId, TE_TOO_LARGE_SIGID);
return false; return false;
} }
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
#include "TCP_Transporter.hpp" #include "TCP_Transporter.hpp"
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include <NdbSleep.h> #include <NdbSleep.h>
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
// End of stuff to be moved // End of stuff to be moved
#if defined NDB_OSE || defined NDB_SOFTOSE #if defined NDB_OSE || defined NDB_SOFTOSE
...@@ -159,14 +162,14 @@ TCP_Transporter::setSocketOptions(){ ...@@ -159,14 +162,14 @@ TCP_Transporter::setSocketOptions(){
if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF, if (setsockopt(theSocket, SOL_SOCKET, SO_RCVBUF,
(char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) { (char*)&sockOptRcvBufSize, sizeof(sockOptRcvBufSize)) < 0) {
#ifdef DEBUG_TRANSPORTER #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 #endif
}//if }//if
if (setsockopt(theSocket, SOL_SOCKET, SO_SNDBUF, if (setsockopt(theSocket, SOL_SOCKET, SO_SNDBUF,
(char*)&sockOptSndBufSize, sizeof(sockOptSndBufSize)) < 0) { (char*)&sockOptSndBufSize, sizeof(sockOptSndBufSize)) < 0) {
#ifdef DEBUG_TRANSPORTER #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 #endif
}//if }//if
...@@ -177,7 +180,7 @@ TCP_Transporter::setSocketOptions(){ ...@@ -177,7 +180,7 @@ TCP_Transporter::setSocketOptions(){
if (setsockopt(theSocket, IPPROTO_TCP, TCP_NODELAY, if (setsockopt(theSocket, IPPROTO_TCP, TCP_NODELAY,
(char*)&sockOptNodelay, sizeof(sockOptNodelay)) < 0) { (char*)&sockOptNodelay, sizeof(sockOptNodelay)) < 0) {
#ifdef DEBUG_TRANSPORTER #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 #endif
}//if }//if
} }
...@@ -191,7 +194,7 @@ TCP_Transporter::setSocketNonBlocking(NDB_SOCKET_TYPE socket){ ...@@ -191,7 +194,7 @@ TCP_Transporter::setSocketNonBlocking(NDB_SOCKET_TYPE socket){
if(ioctlsocket(socket, FIONBIO, &ul)) if(ioctlsocket(socket, FIONBIO, &ul))
{ {
#ifdef DEBUG_TRANSPORTER #ifdef DEBUG_TRANSPORTER
ndbout_c("Set non-blocking server error3: %d", InetErrno); g_eventLogger.error("Set non-blocking server error3: %d", InetErrno);
#endif #endif
}//if }//if
return true; return true;
...@@ -205,13 +208,13 @@ TCP_Transporter::setSocketNonBlocking(NDB_SOCKET_TYPE socket){ ...@@ -205,13 +208,13 @@ TCP_Transporter::setSocketNonBlocking(NDB_SOCKET_TYPE socket){
flags = fcntl(socket, F_GETFL, 0); flags = fcntl(socket, F_GETFL, 0);
if (flags < 0) { if (flags < 0) {
#ifdef DEBUG_TRANSPORTER #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 #endif
}//if }//if
flags |= NDB_NONBLOCK; flags |= NDB_NONBLOCK;
if (fcntl(socket, F_SETFL, flags) == -1) { if (fcntl(socket, F_SETFL, flags) == -1) {
#ifdef DEBUG_TRANSPORTER #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 #endif
}//if }//if
return true; return true;
...@@ -349,7 +352,7 @@ TCP_Transporter::doSend() { ...@@ -349,7 +352,7 @@ TCP_Transporter::doSend() {
} else { } else {
// Send failed // Send failed
#if defined DEBUG_TRANSPORTER #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", "errno = %d strerror = %s",
DISCONNECT_ERRNO(InetErrno, nBytesSent), DISCONNECT_ERRNO(InetErrno, nBytesSent),
remoteNodeId, nBytesSent, InetErrno, remoteNodeId, nBytesSent, InetErrno,
...@@ -384,11 +387,11 @@ TCP_Transporter::doReceive() { ...@@ -384,11 +387,11 @@ TCP_Transporter::doReceive() {
if(receiveBuffer.sizeOfData > receiveBuffer.sizeOfBuffer){ if(receiveBuffer.sizeOfData > receiveBuffer.sizeOfBuffer){
#ifdef DEBUG_TRANSPORTER #ifdef DEBUG_TRANSPORTER
ndbout_c("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)", g_eventLogger.error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)",
receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer); receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer);
ndbout_c("nBytesRead = %d", nBytesRead); g_eventLogger.error("nBytesRead = %d", nBytesRead);
#endif #endif
ndbout_c("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)", g_eventLogger.error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)",
receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer); receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer);
report_error(TE_INVALID_MESSAGE_LENGTH); report_error(TE_INVALID_MESSAGE_LENGTH);
return 0; return 0;
...@@ -405,7 +408,7 @@ TCP_Transporter::doReceive() { ...@@ -405,7 +408,7 @@ TCP_Transporter::doReceive() {
return nBytesRead; return nBytesRead;
} else { } else {
#if defined DEBUG_TRANSPORTER #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", "errno = %d strerror = %s",
DISCONNECT_ERRNO(InetErrno, nBytesRead), DISCONNECT_ERRNO(InetErrno, nBytesRead),
remoteNodeId, nBytesRead, InetErrno, remoteNodeId, nBytesRead, InetErrno,
......
...@@ -891,7 +891,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis) ...@@ -891,7 +891,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout); tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout);
if(false && tcpReadSelectReply == -1 && errno == EINTR) if(false && tcpReadSelectReply == -1 && errno == EINTR)
ndbout_c("woke-up by signal"); g_eventLogger.info("woke-up by signal");
#ifdef NDB_WIN32 #ifdef NDB_WIN32
if(tcpReadSelectReply == SOCKET_ERROR) if(tcpReadSelectReply == SOCKET_ERROR)
...@@ -1313,12 +1313,12 @@ TransporterRegistry::start_clients_thread() ...@@ -1313,12 +1313,12 @@ TransporterRegistry::start_clients_thread()
} }
else if(ndb_mgm_is_connected(m_mgm_handle)) 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); ndb_mgm_disconnect(m_mgm_handle);
} }
else 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). " "It is probably being shut down (or has problems). "
"We will retry the connection."); "We will retry the connection.");
} }
...@@ -1416,7 +1416,7 @@ TransporterRegistry::start_service(SocketServer& socket_server) ...@@ -1416,7 +1416,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
DBUG_ENTER("TransporterRegistry::start_service"); DBUG_ENTER("TransporterRegistry::start_service");
if (m_transporter_interface.size() > 0 && !nodeIdSpecified) 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); DBUG_RETURN(false);
} }
...@@ -1442,7 +1442,7 @@ TransporterRegistry::start_service(SocketServer& socket_server) ...@@ -1442,7 +1442,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
* If it wasn't a dynamically allocated port, or * If it wasn't a dynamically allocated port, or
* our attempts at getting a new dynamic port failed * 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" "Please check if the port is already used,\n"
"(perhaps the node is already running)", "(perhaps the node is already running)",
t.m_interface ? t.m_interface : "*", t.m_s_service_port); t.m_interface ? t.m_interface : "*", t.m_s_service_port);
...@@ -1575,13 +1575,13 @@ bool TransporterRegistry::connect_client(NdbMgmHandle *h) ...@@ -1575,13 +1575,13 @@ bool TransporterRegistry::connect_client(NdbMgmHandle *h)
if(!mgm_nodeid) if(!mgm_nodeid)
{ {
ndbout_c("%s: %d", __FILE__, __LINE__); g_eventLogger.error("%s: %d", __FILE__, __LINE__);
return false; return false;
} }
Transporter * t = theTransporters[mgm_nodeid]; Transporter * t = theTransporters[mgm_nodeid];
if (!t) if (!t)
{ {
ndbout_c("%s: %d", __FILE__, __LINE__); g_eventLogger.error("%s: %d", __FILE__, __LINE__);
return false; return false;
} }
DBUG_RETURN(t->connect_client(connect_ndb_mgmd(h))); DBUG_RETURN(t->connect_client(connect_ndb_mgmd(h)));
...@@ -1597,7 +1597,7 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h) ...@@ -1597,7 +1597,7 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h)
if ( h==NULL || *h == NULL ) if ( h==NULL || *h == NULL )
{ {
ndbout_c("%s: %d", __FILE__, __LINE__); g_eventLogger.error("%s: %d", __FILE__, __LINE__);
return NDB_INVALID_SOCKET; return NDB_INVALID_SOCKET;
} }
...@@ -1610,10 +1610,10 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h) ...@@ -1610,10 +1610,10 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h)
m_transporter_interface[i].m_s_service_port, m_transporter_interface[i].m_s_service_port,
&mgm_reply) < 0) &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_desc(*h),
ndb_mgm_get_latest_error(*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); ndb_mgm_destroy_handle(h);
return NDB_INVALID_SOCKET; return NDB_INVALID_SOCKET;
} }
...@@ -1625,10 +1625,10 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h) ...@@ -1625,10 +1625,10 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h)
NDB_SOCKET_TYPE sockfd= ndb_mgm_convert_to_transporter(h); NDB_SOCKET_TYPE sockfd= ndb_mgm_convert_to_transporter(h);
if ( sockfd == NDB_INVALID_SOCKET) 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_desc(*h),
ndb_mgm_get_latest_error(*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); ndb_mgm_destroy_handle(h);
} }
return sockfd; return sockfd;
......
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