00001 /* Copyright (C) 2003 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 #ifndef NDB_LOGEVENT_H 00018 #define NDB_LOGEVENT_H 00019 00024 #include "mgmapi_config_parameters.h" 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif 00029 00034 enum Ndb_logevent_type { 00035 00036 NDB_LE_ILLEGAL_TYPE = -1, 00037 00039 NDB_LE_Connected = 0, 00041 NDB_LE_Disconnected = 1, 00043 NDB_LE_CommunicationClosed = 2, 00045 NDB_LE_CommunicationOpened = 3, 00047 NDB_LE_ConnectedApiVersion = 51, 00048 00050 NDB_LE_GlobalCheckpointStarted = 4, 00052 NDB_LE_GlobalCheckpointCompleted = 5, 00054 NDB_LE_LocalCheckpointStarted = 6, 00056 NDB_LE_LocalCheckpointCompleted = 7, 00058 NDB_LE_LCPStoppedInCalcKeepGci = 8, 00060 NDB_LE_LCPFragmentCompleted = 9, 00061 00063 NDB_LE_NDBStartStarted = 10, 00065 NDB_LE_NDBStartCompleted = 11, 00067 NDB_LE_STTORRYRecieved = 12, 00069 NDB_LE_StartPhaseCompleted = 13, 00071 NDB_LE_CM_REGCONF = 14, 00073 NDB_LE_CM_REGREF = 15, 00075 NDB_LE_FIND_NEIGHBOURS = 16, 00077 NDB_LE_NDBStopStarted = 17, 00079 NDB_LE_NDBStopCompleted = 53, 00081 NDB_LE_NDBStopForced = 59, 00083 NDB_LE_NDBStopAborted = 18, 00085 NDB_LE_StartREDOLog = 19, 00087 NDB_LE_StartLog = 20, 00089 NDB_LE_UNDORecordsExecuted = 21, 00090 00092 NDB_LE_NR_CopyDict = 22, 00094 NDB_LE_NR_CopyDistr = 23, 00096 NDB_LE_NR_CopyFragsStarted = 24, 00098 NDB_LE_NR_CopyFragDone = 25, 00100 NDB_LE_NR_CopyFragsCompleted = 26, 00101 00102 /* NODEFAIL */ 00104 NDB_LE_NodeFailCompleted = 27, 00106 NDB_LE_NODE_FAILREP = 28, 00108 NDB_LE_ArbitState = 29, 00110 NDB_LE_ArbitResult = 30, 00112 NDB_LE_GCP_TakeoverStarted = 31, 00114 NDB_LE_GCP_TakeoverCompleted = 32, 00116 NDB_LE_LCP_TakeoverStarted = 33, 00118 NDB_LE_LCP_TakeoverCompleted = 34, 00119 00121 NDB_LE_TransReportCounters = 35, 00123 NDB_LE_OperationReportCounters = 36, 00125 NDB_LE_TableCreated = 37, 00127 NDB_LE_UndoLogBlocked = 38, 00129 NDB_LE_JobStatistic = 39, 00131 NDB_LE_SendBytesStatistic = 40, 00133 NDB_LE_ReceiveBytesStatistic = 41, 00135 NDB_LE_MemoryUsage = 50, 00136 00138 NDB_LE_TransporterError = 42, 00140 NDB_LE_TransporterWarning = 43, 00142 NDB_LE_MissedHeartbeat = 44, 00144 NDB_LE_DeadDueToHeartbeat = 45, 00146 NDB_LE_WarningEvent = 46, 00147 00149 NDB_LE_SentHeartbeat = 47, 00151 NDB_LE_CreateLogBytes = 48, 00153 NDB_LE_InfoEvent = 49, 00154 00155 /* 50 used */ 00156 /* 51 used */ 00157 00158 /* SINGLE USER */ 00159 NDB_LE_SingleUser = 52, 00160 /* 53 used */ 00161 00163 NDB_LE_BackupStarted = 54, 00165 NDB_LE_BackupFailedToStart = 55, 00167 NDB_LE_BackupCompleted = 56, 00169 NDB_LE_BackupAborted = 57, 00170 00172 NDB_LE_EventBufferStatus = 58, 00173 00174 /* 59 used */ 00175 00177 NDB_LE_StartReport = 60 00178 00179 /* 60 unused */ 00180 /* 61 unused */ 00181 /* 62 unused */ 00182 00183 }; 00184 00190 enum ndb_mgm_event_severity { 00191 NDB_MGM_ILLEGAL_EVENT_SEVERITY = -1, 00192 /* Must be a nonnegative integer (used for array indexing) */ 00194 NDB_MGM_EVENT_SEVERITY_ON = 0, 00196 NDB_MGM_EVENT_SEVERITY_DEBUG = 1, 00198 NDB_MGM_EVENT_SEVERITY_INFO = 2, 00201 NDB_MGM_EVENT_SEVERITY_WARNING = 3, 00203 NDB_MGM_EVENT_SEVERITY_ERROR = 4, 00205 NDB_MGM_EVENT_SEVERITY_CRITICAL = 5, 00209 NDB_MGM_EVENT_SEVERITY_ALERT = 6, 00210 /* must be next number, works as bound in loop */ 00212 NDB_MGM_EVENT_SEVERITY_ALL = 7 00213 }; 00214 00219 enum ndb_mgm_event_category { 00223 NDB_MGM_ILLEGAL_EVENT_CATEGORY = -1, 00227 NDB_MGM_EVENT_CATEGORY_STARTUP = CFG_LOGLEVEL_STARTUP, 00231 NDB_MGM_EVENT_CATEGORY_SHUTDOWN = CFG_LOGLEVEL_SHUTDOWN, 00235 NDB_MGM_EVENT_CATEGORY_STATISTIC = CFG_LOGLEVEL_STATISTICS, 00239 NDB_MGM_EVENT_CATEGORY_CHECKPOINT = CFG_LOGLEVEL_CHECKPOINT, 00243 NDB_MGM_EVENT_CATEGORY_NODE_RESTART = CFG_LOGLEVEL_NODERESTART, 00247 NDB_MGM_EVENT_CATEGORY_CONNECTION = CFG_LOGLEVEL_CONNECTION, 00251 NDB_MGM_EVENT_CATEGORY_BACKUP = CFG_LOGLEVEL_BACKUP, 00255 NDB_MGM_EVENT_CATEGORY_CONGESTION = CFG_LOGLEVEL_CONGESTION, 00256 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00257 00260 NDB_MGM_EVENT_CATEGORY_DEBUG = CFG_LOGLEVEL_DEBUG, 00261 #endif 00262 00265 NDB_MGM_EVENT_CATEGORY_INFO = CFG_LOGLEVEL_INFO, 00269 NDB_MGM_EVENT_CATEGORY_ERROR = CFG_LOGLEVEL_ERROR, 00270 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00271 NDB_MGM_MIN_EVENT_CATEGORY = CFG_MIN_LOGLEVEL, 00272 NDB_MGM_MAX_EVENT_CATEGORY = CFG_MAX_LOGLEVEL 00273 #endif 00274 }; 00275 00280 struct ndb_logevent { 00284 void *handle; 00285 00287 enum Ndb_logevent_type type; 00288 00290 unsigned time; 00291 00293 enum ndb_mgm_event_category category; 00294 00296 enum ndb_mgm_event_severity severity; 00297 00299 unsigned level; 00300 00302 unsigned source_nodeid; 00303 00307 union { 00308 /* CONNECT */ 00310 struct { 00311 unsigned node; 00312 } Connected; 00313 00315 struct { 00316 unsigned node; 00317 } Disconnected; 00318 00320 struct { 00321 unsigned node; 00322 } CommunicationClosed; 00323 00325 struct { 00326 unsigned node; 00327 } CommunicationOpened; 00328 00330 struct { 00331 unsigned node; 00332 unsigned version; 00333 } ConnectedApiVersion; 00334 00335 /* CHECKPOINT */ 00337 struct { 00338 unsigned gci; 00339 } GlobalCheckpointStarted; 00341 struct { 00342 unsigned gci; 00343 } GlobalCheckpointCompleted; 00345 struct { 00346 unsigned lci; 00347 unsigned keep_gci; 00348 unsigned restore_gci; 00349 } LocalCheckpointStarted; 00351 struct { 00352 unsigned lci; 00353 } LocalCheckpointCompleted; 00355 struct { 00356 unsigned data; 00357 } LCPStoppedInCalcKeepGci; 00359 struct { 00360 unsigned node; 00361 unsigned table_id; 00362 unsigned fragment_id; 00363 } LCPFragmentCompleted; 00365 struct { 00366 unsigned acc_count; 00367 unsigned tup_count; 00368 } UndoLogBlocked; 00369 00370 /* STARTUP */ 00372 struct { 00373 unsigned version; 00374 } NDBStartStarted; 00376 struct { 00377 unsigned version; 00378 } NDBStartCompleted; 00380 struct { 00381 } STTORRYRecieved; 00383 struct { 00384 unsigned phase; 00385 unsigned starttype; 00386 } StartPhaseCompleted; 00388 struct { 00389 unsigned own_id; 00390 unsigned president_id; 00391 unsigned dynamic_id; 00392 } CM_REGCONF; 00394 struct { 00395 unsigned own_id; 00396 unsigned other_id; 00397 unsigned cause; 00398 } CM_REGREF; 00400 struct { 00401 unsigned own_id; 00402 unsigned left_id; 00403 unsigned right_id; 00404 unsigned dynamic_id; 00405 } FIND_NEIGHBOURS; 00407 struct { 00408 unsigned stoptype; 00409 } NDBStopStarted; 00411 struct { 00412 unsigned action; 00413 unsigned signum; 00414 } NDBStopCompleted; 00416 struct { 00417 unsigned action; 00418 unsigned signum; 00419 unsigned error; 00420 unsigned sphase; 00421 unsigned extra; 00422 } NDBStopForced; 00424 struct { 00425 } NDBStopAborted; 00427 struct { 00428 unsigned node; 00429 unsigned keep_gci; 00430 unsigned completed_gci; 00431 unsigned restorable_gci; 00432 } StartREDOLog; 00434 struct { 00435 unsigned log_part; 00436 unsigned start_mb; 00437 unsigned stop_mb; 00438 unsigned gci; 00439 } StartLog; 00441 struct { 00442 unsigned block; 00443 unsigned data1; 00444 unsigned data2; 00445 unsigned data3; 00446 unsigned data4; 00447 unsigned data5; 00448 unsigned data6; 00449 unsigned data7; 00450 unsigned data8; 00451 unsigned data9; 00452 unsigned data10; 00453 } UNDORecordsExecuted; 00454 00455 /* NODERESTART */ 00457 struct { 00458 } NR_CopyDict; 00460 struct { 00461 } NR_CopyDistr; 00463 struct { 00464 unsigned dest_node; 00465 } NR_CopyFragsStarted; 00467 struct { 00468 unsigned dest_node; 00469 unsigned table_id; 00470 unsigned fragment_id; 00471 } NR_CopyFragDone; 00473 struct { 00474 unsigned dest_node; 00475 } NR_CopyFragsCompleted; 00476 00478 struct { 00479 unsigned block; /* 0 = all */ 00480 unsigned failed_node; 00481 unsigned completing_node; /* 0 = all */ 00482 } NodeFailCompleted; 00484 struct { 00485 unsigned failed_node; 00486 unsigned failure_state; 00487 } NODE_FAILREP; 00489 struct { 00490 unsigned code; /* code & state << 16 */ 00491 unsigned arbit_node; 00492 unsigned ticket_0; 00493 unsigned ticket_1; 00494 /* TODO */ 00495 } ArbitState; 00497 struct { 00498 unsigned code; /* code & state << 16 */ 00499 unsigned arbit_node; 00500 unsigned ticket_0; 00501 unsigned ticket_1; 00502 /* TODO */ 00503 } ArbitResult; 00505 struct { 00506 } GCP_TakeoverStarted; 00508 struct { 00509 } GCP_TakeoverCompleted; 00511 struct { 00512 } LCP_TakeoverStarted; 00514 struct { 00515 unsigned state; 00516 } LCP_TakeoverCompleted; 00517 00518 /* STATISTIC */ 00520 struct { 00521 unsigned trans_count; 00522 unsigned commit_count; 00523 unsigned read_count; 00524 unsigned simple_read_count; 00525 unsigned write_count; 00526 unsigned attrinfo_count; 00527 unsigned conc_op_count; 00528 unsigned abort_count; 00529 unsigned scan_count; 00530 unsigned range_scan_count; 00531 } TransReportCounters; 00533 struct { 00534 unsigned ops; 00535 } OperationReportCounters; 00537 struct { 00538 unsigned table_id; 00539 } TableCreated; 00541 struct { 00542 unsigned mean_loop_count; 00543 } JobStatistic; 00545 struct { 00546 unsigned to_node; 00547 unsigned mean_sent_bytes; 00548 } SendBytesStatistic; 00550 struct { 00551 unsigned from_node; 00552 unsigned mean_received_bytes; 00553 } ReceiveBytesStatistic; 00555 struct { 00556 int gth; 00557 unsigned page_size_kb; 00558 unsigned pages_used; 00559 unsigned pages_total; 00560 unsigned block; 00561 } MemoryUsage; 00562 00563 /* ERROR */ 00565 struct { 00566 unsigned to_node; 00567 unsigned code; 00568 } TransporterError; 00570 struct { 00571 unsigned to_node; 00572 unsigned code; 00573 } TransporterWarning; 00575 struct { 00576 unsigned node; 00577 unsigned count; 00578 } MissedHeartbeat; 00580 struct { 00581 unsigned node; 00582 } DeadDueToHeartbeat; 00584 struct { 00585 /* TODO */ 00586 } WarningEvent; 00587 00588 /* INFO */ 00590 struct { 00591 unsigned node; 00592 } SentHeartbeat; 00594 struct { 00595 unsigned node; 00596 } CreateLogBytes; 00598 struct { 00599 /* TODO */ 00600 } InfoEvent; 00602 struct { 00603 unsigned usage; 00604 unsigned alloc; 00605 unsigned max; 00606 unsigned apply_gci_l; 00607 unsigned apply_gci_h; 00608 unsigned latest_gci_l; 00609 unsigned latest_gci_h; 00610 } EventBufferStatus; 00611 00613 struct { 00614 unsigned starting_node; 00615 unsigned backup_id; 00616 } BackupStarted; 00618 struct { 00619 unsigned starting_node; 00620 unsigned error; 00621 } BackupFailedToStart; 00623 struct { 00624 unsigned starting_node; 00625 unsigned backup_id; 00626 unsigned start_gci; 00627 unsigned stop_gci; 00628 unsigned n_records; 00629 unsigned n_log_records; 00630 unsigned n_bytes; 00631 unsigned n_log_bytes; 00632 } BackupCompleted; 00634 struct { 00635 unsigned starting_node; 00636 unsigned backup_id; 00637 unsigned error; 00638 } BackupAborted; 00640 struct { 00641 unsigned type; 00642 unsigned node_id; 00643 } SingleUser; 00645 struct { 00646 unsigned report_type; 00647 unsigned remaining_time; 00648 unsigned bitmask_size; 00649 unsigned bitmask_data[1]; 00650 } StartReport; 00651 #ifndef DOXYGEN_FIX 00652 }; 00653 #else 00654 } <union>; 00655 #endif 00656 }; 00657 00658 enum ndb_logevent_handle_error { 00659 NDB_LEH_NO_ERROR, 00660 NDB_LEH_READ_ERROR, 00661 NDB_LEH_MISSING_EVENT_SPECIFIER, 00662 NDB_LEH_UNKNOWN_EVENT_TYPE, 00663 NDB_LEH_UNKNOWN_EVENT_VARIABLE, 00664 NDB_LEH_INTERNAL_ERROR 00665 }; 00666 00667 #ifdef __cplusplus 00668 } 00669 #endif 00670 00673 #endif
1.4.7

