eventlogger.cpp

来自「这个文件是windows mysql源码」· C++ 代码 · 共 1,120 行 · 第 1/3 页

CPP
1,120
字号
      break;    case ArbitCode::LoseNorun:      BaseString::snprintf(m_text, m_text_len,			   "Network partitioning - no arbitrator available");      break;    case ArbitCode::LoseNocfg:      BaseString::snprintf(m_text, m_text_len,			   "Network partitioning - no arbitrator configured");      break;    default:      ArbitCode::getErrText(code, errText, sizeof(errText));      BaseString::snprintf(m_text, m_text_len,			   "Arbitration failure - %s [state=%u]",			   errText, state);      break;    }  }}void getTextGlobalCheckpointStarted(QQQQ) {  //-----------------------------------------------------------------------  // This event reports that a global checkpoint has been started and this  // node is the master of this global checkpoint.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Global checkpoint %u started", 		       theData[1]);}void getTextGlobalCheckpointCompleted(QQQQ) {  //-----------------------------------------------------------------------  // This event reports that a global checkpoint has been completed on this  // node and the node is the master of this global checkpoint.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Global checkpoint %u completed", 		       theData[1]);}void getTextLocalCheckpointStarted(QQQQ) {  //-----------------------------------------------------------------------  // This event reports that a local checkpoint has been started and this  // node is the master of this local checkpoint.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Local checkpoint %u started. "		       "Keep GCI = %u oldest restorable GCI = %u", 		       theData[1], 		       theData[2], 		       theData[3]);}void getTextLocalCheckpointCompleted(QQQQ) {  //-----------------------------------------------------------------------  // This event reports that a local checkpoint has been completed on this  // node and the node is the master of this local checkpoint.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Local checkpoint %u completed", 		       theData[1]);}void getTextTableCreated(QQQQ) {  //-----------------------------------------------------------------------  // This event reports that a table has been created.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Table with ID =  %u created", 		       theData[1]);}/* STRANGE */void getTextLCPStoppedInCalcKeepGci(QQQQ) {  if (theData[1] == 0)    BaseString::snprintf(m_text, m_text_len, 			 "Local Checkpoint stopped in CALCULATED_KEEP_GCI");}void getTextNR_CopyDict(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Node Restart completed copy of dictionary information.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Node restart completed copy of dictionary information");}void getTextNR_CopyDistr(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Node Restart completed copy of distribution information.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Node restart completed copy of distribution information");}void getTextNR_CopyFragsStarted(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Node Restart is starting to copy the fragments.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Node restart starting to copy the fragments "		       "to Node %u", 		       theData[1]);}void getTextNR_CopyFragDone(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Node Restart copied a fragment.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Table ID = %u, fragment ID = %u have been copied "		       "to Node %u", 		       theData[2], 		       theData[3], 		       theData[1]);}void getTextNR_CopyFragsCompleted(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Node restart completed copying the fragments "		       "to Node %u", 		       theData[1]);}void getTextLCPFragmentCompleted(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Table ID = %u, fragment ID = %u has completed LCP "		       "on Node %u maxGciStarted: %d maxGciCompleted: %d", 		       theData[2], 		       theData[3], 		       theData[1],		       theData[4],		       theData[5]);}void getTextTransReportCounters(QQQQ) {  // -------------------------------------------------------------------    // Report information about transaction activity once per 10 seconds.  // -------------------------------------------------------------------   BaseString::snprintf(m_text, m_text_len, 		       "Trans. Count = %u, Commit Count = %u, "		       "Read Count = %u, Simple Read Count = %u,\n"		       "Write Count = %u, AttrInfo Count = %u, "		       "Concurrent Operations = %u, Abort Count = %u\n"		       " Scans: %u Range scans: %u", 		       theData[1], 		       theData[2], 		       theData[3], 		       theData[4],		       theData[5], 		       theData[6], 		       theData[7], 		       theData[8],		       theData[9],		       theData[10]);}void getTextOperationReportCounters(QQQQ) {  BaseString::snprintf(m_text, m_text_len,		       "Operations=%u",		       theData[1]);}void getTextUndoLogBlocked(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Undo Logging blocked due to buffer near to overflow.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "ACC Blocked %u and TUP Blocked %u times last second",		       theData[1],		       theData[2]);}void getTextTransporterError(QQQQ) {  struct myTransporterError{    Uint32 errorNum;    char   errorString[256];  };  int i = 0;  int lenth = 0;  static const struct myTransporterError TransporterErrorString[]=  {    //TE_NO_ERROR = 0    {TE_NO_ERROR,"No error"},    //TE_ERROR_CLOSING_SOCKET = 0x1    {TE_ERROR_CLOSING_SOCKET,"Error found during closing of socket"},    //TE_ERROR_IN_SELECT_BEFORE_ACCEPT = 0x2    {TE_ERROR_IN_SELECT_BEFORE_ACCEPT,"Error found before accept. The transporter will retry"},    //TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT    {TE_INVALID_MESSAGE_LENGTH,"Error found in message (invalid message length)"},    //TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT    {TE_INVALID_CHECKSUM,"Error found in message (checksum)"},    //TE_COULD_NOT_CREATE_SOCKET = 0x5    {TE_COULD_NOT_CREATE_SOCKET,"Error found while creating socket(can't create socket)"},    //TE_COULD_NOT_BIND_SOCKET = 0x6    {TE_COULD_NOT_BIND_SOCKET,"Error found while binding server socket"},    //TE_LISTEN_FAILED = 0x7    {TE_LISTEN_FAILED,"Error found while listening to server socket"},    //TE_ACCEPT_RETURN_ERROR = 0x8    {TE_ACCEPT_RETURN_ERROR,"Error found during accept(accept return error)"},    //TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT    {TE_SHM_DISCONNECT,"The remote node has disconnected"},    //TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT    {TE_SHM_IPC_STAT,"Unable to check shm segment"},    //TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd    {TE_SHM_UNABLE_TO_CREATE_SEGMENT,"Unable to create shm segment"},    //TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe    {TE_SHM_UNABLE_TO_ATTACH_SEGMENT,"Unable to attach shm segment"},    //TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf    {TE_SHM_UNABLE_TO_REMOVE_SEGMENT,"Unable to remove shm segment"},    //TE_TOO_SMALL_SIGID = 0x10    {TE_TOO_SMALL_SIGID,"Sig ID too small"},    //TE_TOO_LARGE_SIGID = 0x11    {TE_TOO_LARGE_SIGID,"Sig ID too large"},    //TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT    {TE_WAIT_STACK_FULL,"Wait stack was full"},    //TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT    {TE_RECEIVE_BUFFER_FULL,"Receive buffer was full"},    //TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT    {TE_SIGNAL_LOST_SEND_BUFFER_FULL,"Send buffer was full,and trying to force send fails"},    //TE_SIGNAL_LOST = 0x15    {TE_SIGNAL_LOST,"Send failed for unknown reason(signal lost)"},    //TE_SEND_BUFFER_FULL = 0x16    {TE_SEND_BUFFER_FULL,"The send buffer was full, but sleeping for a while solved"},    //TE_SCI_LINK_ERROR = 0x0017    {TE_SCI_LINK_ERROR,"There is no link from this node to the switch"},    //TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT    {TE_SCI_UNABLE_TO_START_SEQUENCE,"Could not start a sequence, because system resources are exumed or no sequence has been created"},    //TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT    {TE_SCI_UNABLE_TO_REMOVE_SEQUENCE,"Could not remove a sequence"},    //TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT    {TE_SCI_UNABLE_TO_CREATE_SEQUENCE,"Could not create a sequence, because system resources are exempted. Must reboot"},    //TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT    {TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR,"Tried to send data on redundant link but failed"},    //TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT    {TE_SCI_CANNOT_INIT_LOCALSEGMENT,"Cannot initialize local segment"},    //TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNEC    {TE_SCI_CANNOT_MAP_REMOTESEGMENT,"Cannot map remote segment"},    //TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT    {TE_SCI_UNABLE_TO_UNMAP_SEGMENT,"Cannot free the resources used by this segment (step 1)"},    //TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f  | TE_DO_DISCONNEC    {TE_SCI_UNABLE_TO_REMOVE_SEGMENT,"Cannot free the resources used by this segment (step 2)"},    //TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT    {TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT,"Cannot disconnect from a remote segment"},    //TE_SHM_IPC_PERMANENT = 0x21    {TE_SHM_IPC_PERMANENT,"Shm ipc Permanent error"},    //TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22    {TE_SCI_UNABLE_TO_CLOSE_CHANNEL,"Unable to close the sci channel and the resources allocated"}  };  lenth = sizeof(TransporterErrorString)/sizeof(struct myTransporterError);  for(i=0; i<lenth; i++)  {    if(theData[2] == TransporterErrorString[i].errorNum)    {      BaseString::snprintf(m_text, m_text_len,                          "Transporter to node %d reported error 0x%x: %s",                          theData[1],			  theData[2],                          TransporterErrorString[i].errorString);      break;    }  }  if(i == lenth)    BaseString::snprintf(m_text, m_text_len,                           "Transporter to node %d reported error 0x%x: unknown error",                          theData[1],			  theData[2]);}void getTextTransporterWarning(QQQQ) {  getTextTransporterError(m_text, m_text_len, theData);}void getTextMissedHeartbeat(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Undo Logging blocked due to buffer near to overflow.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Node %d missed heartbeat %d",		       theData[1],		       theData[2]);}void getTextDeadDueToHeartbeat(QQQQ) {  //-----------------------------------------------------------------------  // REPORT Undo Logging blocked due to buffer near to overflow.  //-----------------------------------------------------------------------  BaseString::snprintf(m_text, m_text_len, 		       "Node %d declared dead due to missed heartbeat",		       theData[1]);}void getTextJobStatistic(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Mean loop Counter in doJob last 8192 times = %u",		       theData[1]);}void getTextSendBytesStatistic(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Mean send size to Node = %d last 4096 sends = %u bytes",		       theData[1],		       theData[2]);}void getTextReceiveBytesStatistic(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Mean receive size to Node = %d last 4096 sends = %u bytes",		       theData[1],		       theData[2]);}void getTextSentHeartbeat(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Node Sent Heartbeat to node = %d",		       theData[1]);}void getTextCreateLogBytes(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Log part %u, log file %u, MB %u",		       theData[1],		       theData[2],		       theData[3]);}void getTextStartLog(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Log part %u, start MB %u, stop MB %u, last GCI, log exec %u",		       theData[1],		       theData[2],		       theData[3],		       theData[4]);}void getTextStartREDOLog(QQQQ) {  BaseString::snprintf(m_text, m_text_len, 		       "Node: %d StartLog: [GCI Keep: %d LastCompleted: %d NewestRestorable: %d]",		       theData[1],		       theData[2],		       theData[3],		       theData[4]);}void getTextUNDORecordsExecuted(QQQQ) {  const char* line = "";  if (theData[1] == DBTUP){    line = "DBTUP";  }else if (theData[1] == DBACC){    line = "DBACC";  }      BaseString::snprintf(m_text, m_text_len, 		       " UNDO %s %d [%d %d %d %d %d %d %d %d %d]",		       line,		       theData[2],		       theData[3],		       theData[4],		       theData[5],		       theData[6],		       theData[7],		       theData[8],		       theData[9],		       theData[10],		       theData[11]);}void getTextInfoEvent(QQQQ) {  BaseString::snprintf(m_text, m_text_len, (char *)&theData[1]);}void getTextWarningEvent(QQQQ) {  BaseString::snprintf(m_text, m_text_len, (char *)&theData[1]);}void getTextGCP_TakeoverStarted(QQQQ) {  BaseString::snprintf(m_text, m_text_len, "GCP Take over started");}void getTextGCP_TakeoverCompleted(QQQQ) {  BaseString::snprintf(m_text, m_text_len, "GCP Take over completed");}void getTextLCP_TakeoverStarted(QQQQ) {  BaseString::snprintf(m_text, m_text_len, "LCP Take over started");}void getTextLCP_TakeoverCompleted(QQQQ) {  BaseString::snprintf(m_text, m_text_len,		       "LCP Take over completed (state = %d)", 		       theData[1]);}void getTextMemoryUsage(QQQQ) {  const int gth = theData[1];  const int size = theData[2];  const int used = theData[3];  const int total = theData[4];  const int block = theData[5];  const int percent = total ? (used*100)/total : 0;    BaseString::snprintf(m_text, m_text_len,		       "%s usage %s %d%s(%d %dK pages of total %d)",		       (block==DBACC ? "Index" : (block == DBTUP ?"Data":"<unknown>")),		       (gth == 0 ? "is" : (gth > 0 ? "increased to" : "decreased to")),		       percent, "%",		       used, size/1024, total		       );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?