MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_logevent.h
1 /*
2  Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef NDB_LOGEVENT_H
19 #define NDB_LOGEVENT_H
20 
25 #include "mgmapi_config_parameters.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
36 
37  NDB_LE_ILLEGAL_TYPE = -1,
38 
49 
62 
91 
102 
103  /* NODEFAIL */
126 
145 
156 
163 
164  /* 50 used */
165  /* 51 used */
166 
167  /* SINGLE USER */
168  NDB_LE_SingleUser = 52,
169  /* 53 used */
170 
191 
194 
195  /* 59 used */
196 
199 
200  /* 61 (used in upcoming patch) */
201  /* 62-72 used */
204 
205  NDB_LE_MTSignalStatistics = 70,
206 
211 
212  ,NDB_LE_RedoStatus = 73
213  ,NDB_LE_CreateSchemaObject = 74
214  ,NDB_LE_AlterSchemaObject = 75
215  ,NDB_LE_DropSchemaObject = 76
216  ,NDB_LE_StartReadLCP = 77
217  ,NDB_LE_ReadLCPComplete = 78
218  ,NDB_LE_RunRedo = 79
219  ,NDB_LE_RebuildIndex = 80
220  ,NDB_LE_SavedEvent = 81
221  };
222 
229  NDB_MGM_ILLEGAL_EVENT_SEVERITY = -1,
230  /* Must be a nonnegative integer (used for array indexing) */
248  /* must be next number, works as bound in loop */
251  };
252 
265  NDB_MGM_EVENT_CATEGORY_STARTUP = CFG_LOGLEVEL_STARTUP,
269  NDB_MGM_EVENT_CATEGORY_SHUTDOWN = CFG_LOGLEVEL_SHUTDOWN,
273  NDB_MGM_EVENT_CATEGORY_STATISTIC = CFG_LOGLEVEL_STATISTICS,
277  NDB_MGM_EVENT_CATEGORY_CHECKPOINT = CFG_LOGLEVEL_CHECKPOINT,
281  NDB_MGM_EVENT_CATEGORY_NODE_RESTART = CFG_LOGLEVEL_NODERESTART,
285  NDB_MGM_EVENT_CATEGORY_CONNECTION = CFG_LOGLEVEL_CONNECTION,
289  NDB_MGM_EVENT_CATEGORY_BACKUP = CFG_LOGLEVEL_BACKUP,
293  NDB_MGM_EVENT_CATEGORY_CONGESTION = CFG_LOGLEVEL_CONGESTION,
294 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
295 
298  NDB_MGM_EVENT_CATEGORY_DEBUG = CFG_LOGLEVEL_DEBUG,
299 #endif
300 
303  NDB_MGM_EVENT_CATEGORY_INFO = CFG_LOGLEVEL_INFO,
307  NDB_MGM_EVENT_CATEGORY_ERROR = CFG_LOGLEVEL_ERROR,
308 
309  NDB_MGM_EVENT_CATEGORY_SCHEMA = CFG_LOGLEVEL_SCHEMA,
310 
311 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
312  NDB_MGM_MIN_EVENT_CATEGORY = CFG_MIN_LOGLEVEL,
313  NDB_MGM_MAX_EVENT_CATEGORY = CFG_MAX_LOGLEVEL
314 #endif
315  };
316 
318  unsigned node;
319  };
320 
322  unsigned node;
323  };
324 
326  unsigned node;
327  };
328 
330  unsigned node;
331  };
332 
334  unsigned node;
335  unsigned version;
336  };
337 
338  /* CHECKPOINT */
340  unsigned gci;
341  };
343  unsigned gci;
344  };
346  unsigned lci;
347  unsigned keep_gci;
348  unsigned restore_gci;
349  };
351  unsigned lci;
352  };
354  unsigned data;
355  };
357  unsigned node;
358  unsigned table_id;
359  unsigned fragment_id;
360  };
362  unsigned acc_count;
363  unsigned tup_count;
364  };
365 
366  /* STARTUP */
368  unsigned version;
369  };
371  unsigned version;
372  };
374  unsigned unused;
375  };
377  unsigned phase;
378  unsigned starttype;
379  };
381  unsigned own_id;
382  unsigned president_id;
383  unsigned dynamic_id;
384  };
386  unsigned own_id;
387  unsigned other_id;
388  unsigned cause;
389  };
391  unsigned own_id;
392  unsigned left_id;
393  unsigned right_id;
394  unsigned dynamic_id;
395  };
397  unsigned stoptype;
398  };
400  unsigned action;
401  unsigned signum;
402  };
404  unsigned action;
405  unsigned signum;
406  unsigned error;
407  unsigned sphase;
408  unsigned extra;
409  };
411  unsigned _unused;
412  };
414  unsigned node;
415  unsigned keep_gci;
416  unsigned completed_gci;
417  unsigned restorable_gci;
418  };
420  unsigned log_part;
421  unsigned start_mb;
422  unsigned stop_mb;
423  unsigned gci;
424  };
426  unsigned block;
427  unsigned data1;
428  unsigned data2;
429  unsigned data3;
430  unsigned data4;
431  unsigned data5;
432  unsigned data6;
433  unsigned data7;
434  unsigned data8;
435  unsigned data9;
436  unsigned data10;
437  };
438 
439  /* NODERESTART */
441  unsigned _unused;
442  };
444  unsigned _unused;
445  };
447  unsigned dest_node;
448  };
450  unsigned dest_node;
451  unsigned table_id;
452  unsigned fragment_id;
453  };
455  unsigned dest_node;
456  };
457 
459  unsigned block; /* 0 = all */
460  unsigned failed_node;
461  unsigned completing_node; /* 0 = all */
462  };
464  unsigned failed_node;
465  unsigned failure_state;
466  };
468  unsigned code; /* code & state << 16 */
469  unsigned arbit_node;
470  unsigned ticket_0;
471  unsigned ticket_1;
472  /* TODO */
473  };
475  unsigned code; /* code & state << 16 */
476  unsigned arbit_node;
477  unsigned ticket_0;
478  unsigned ticket_1;
479  /* TODO */
480  };
482  unsigned _unused;
483  };
485  unsigned _unused;
486  };
488  unsigned _unused;
489  };
491  unsigned state;
492  };
494  unsigned other_node_count;
495  unsigned reason;
496  unsigned causing_node;
497  };
499  unsigned nodes_checked;
500  unsigned nodes_suspect;
501  unsigned nodes_failed;
502  };
504  unsigned reason;
505  unsigned failed_node;
506  unsigned source_node;
507  };
508 
509  /* STATISTIC */
511  unsigned trans_count;
512  unsigned commit_count;
513  unsigned read_count;
514  unsigned simple_read_count;
515  unsigned write_count;
516  unsigned attrinfo_count;
517  unsigned conc_op_count;
518  unsigned abort_count;
519  unsigned scan_count;
520  unsigned range_scan_count;
521  };
523  unsigned ops;
524  };
526  unsigned table_id;
527  };
529  unsigned mean_loop_count;
530  };
532  unsigned to_node;
533  unsigned mean_sent_bytes;
534  };
536  unsigned from_node;
537  unsigned mean_received_bytes;
538  };
540  int gth;
541  /* union is for compatibility backward.
542  * page_size_kb member variable should be removed in the future
543  */
544  union {
545  unsigned page_size_kb;
546  unsigned page_size_bytes;
547  };
548  unsigned pages_used;
549  unsigned pages_total;
550  unsigned block;
551  };
552 
553  /* ERROR */
555  unsigned to_node;
556  unsigned code;
557  };
559  unsigned to_node;
560  unsigned code;
561  };
563  unsigned node;
564  unsigned count;
565  };
567  unsigned node;
568  };
570  /* TODO */
571  unsigned _unused;
572  };
573 
574  /* INFO */
576  unsigned node;
577  };
579  unsigned node;
580  };
582  /* TODO */
583  unsigned _unused;
584  };
586  unsigned usage;
587  unsigned alloc;
588  unsigned max;
589  unsigned apply_gci_l;
590  unsigned apply_gci_h;
591  unsigned latest_gci_l;
592  unsigned latest_gci_h;
593  };
594 
597  unsigned starting_node;
598  unsigned backup_id;
599  };
602  unsigned starting_node;
603  unsigned error;
604  };
607  unsigned starting_node;
608  unsigned backup_id;
609  unsigned start_gci;
610  unsigned stop_gci;
611  unsigned n_records;
612  unsigned n_log_records;
613  unsigned n_bytes;
614  unsigned n_log_bytes;
615  unsigned n_records_hi;
616  unsigned n_log_records_hi;
617  unsigned n_bytes_hi;
618  unsigned n_log_bytes_hi;
619  };
622  unsigned starting_node;
623  unsigned backup_id;
624  unsigned n_records_lo;
625  unsigned n_records_hi;
626  unsigned n_log_records_lo;
627  unsigned n_log_records_hi;
628  unsigned n_bytes_lo;
629  unsigned n_bytes_hi;
630  unsigned n_log_bytes_lo;
631  unsigned n_log_bytes_hi;
632  };
633 
636  unsigned starting_node;
637  unsigned backup_id;
638  unsigned error;
639  };
640 
643  unsigned backup_id;
644  unsigned node_id;
645  };
648  unsigned backup_id;
649  unsigned node_id;
650  unsigned n_tables;
651  unsigned n_tablespaces;
652  unsigned n_logfilegroups;
653  unsigned n_datafiles;
654  unsigned n_undofiles;
655  };
658  unsigned backup_id;
659  unsigned node_id;
660  unsigned n_records_lo;
661  unsigned n_records_hi;
662  unsigned n_bytes_lo;
663  unsigned n_bytes_hi;
664  };
667  unsigned backup_id;
668  unsigned node_id;
669  unsigned n_records_lo;
670  unsigned n_records_hi;
671  unsigned n_bytes_lo;
672  unsigned n_bytes_hi;
673  };
676  unsigned backup_id;
677  unsigned node_id;
678  };
679 
682  unsigned type;
683  unsigned node_id;
684  };
687  unsigned report_type;
688  unsigned remaining_time;
689  unsigned bitmask_size;
690  unsigned bitmask_data[1];
691  };
692 
695  unsigned report_type;
696  unsigned node_id;
697  };
698 
701  unsigned log_part;
702  unsigned head_file_no;
703  unsigned head_mbyte;
704  unsigned tail_file_no;
705  unsigned tail_mbyte;
706  unsigned total_hi;
707  unsigned total_lo;
708  unsigned free_hi;
709  unsigned free_lo;
710  };
711 
714  unsigned node_id;
715  unsigned total_files;
716  unsigned file_done;
717  unsigned total_mbytes;
718  unsigned mbytes_done;
719  };
720 
723  unsigned thr_no;
724  unsigned prioa_count;
725  unsigned prioa_size;
726  unsigned priob_count;
727  unsigned priob_size;
728  };
729 
731  unsigned objectid;
732  unsigned version;
733  unsigned type;
734  unsigned node; /* Node create object */
735  };
736 
738  unsigned objectid;
739  unsigned version;
740  unsigned type;
741  unsigned node; /* Node create object */
742  };
743 
745  unsigned objectid;
746  unsigned version;
747  unsigned type;
748  unsigned node; /* Node create object */
749  };
750 
752  unsigned tableid;
753  unsigned fragmentid;
754  };
755 
757  unsigned tableid;
758  unsigned fragmentid;
759  unsigned rows_hi;
760  unsigned rows_lo;
761  };
762 
764  unsigned logpart;
765  unsigned phase;
766  unsigned startgci;
767  unsigned currgci;
768  unsigned stopgci;
769  unsigned startfile;
770  unsigned startmb;
771  unsigned currfile;
772  unsigned currmb;
773  unsigned stopfile;
774  unsigned stopmb;
775  };
776 
778  unsigned instance;
779  unsigned indexid;
780  };
781 
783  unsigned len;
784  unsigned seq;
785  unsigned time;
786  unsigned data[1];
787  };
788 
793  struct ndb_logevent {
797  void *handle;
798 
801 
803  unsigned time;
804 
807 
810 
812  unsigned level;
813 
815  unsigned source_nodeid;
816 
820  union {
821  /* CONNECT */
822  struct ndb_logevent_Connected Connected;
823  struct ndb_logevent_Disconnected Disconnected;
824  struct ndb_logevent_CommunicationClosed CommunicationClosed;
825  struct ndb_logevent_CommunicationOpened CommunicationOpened;
826  struct ndb_logevent_ConnectedApiVersion ConnectedApiVersion;
827 
828  /* CHECKPOINT */
829  struct ndb_logevent_GlobalCheckpointStarted GlobalCheckpointStarted;
830  struct ndb_logevent_GlobalCheckpointCompleted GlobalCheckpointCompleted;
831  struct ndb_logevent_LocalCheckpointStarted LocalCheckpointStarted;
832  struct ndb_logevent_LocalCheckpointCompleted LocalCheckpointCompleted;
833  struct ndb_logevent_LCPStoppedInCalcKeepGci LCPStoppedInCalcKeepGci;
834  struct ndb_logevent_LCPFragmentCompleted LCPFragmentCompleted;
835  struct ndb_logevent_UndoLogBlocked UndoLogBlocked;
836 
837  /* STARTUP */
838  struct ndb_logevent_NDBStartStarted NDBStartStarted;
839  struct ndb_logevent_NDBStartCompleted NDBStartCompleted;
840  struct ndb_logevent_STTORRYRecieved STTORRYRecieved;
841  struct ndb_logevent_StartPhaseCompleted StartPhaseCompleted;
842  struct ndb_logevent_CM_REGCONF CM_REGCONF;
843  struct ndb_logevent_CM_REGREF CM_REGREF;
844  struct ndb_logevent_FIND_NEIGHBOURS FIND_NEIGHBOURS;
845  struct ndb_logevent_NDBStopStarted NDBStopStarted;
846  struct ndb_logevent_NDBStopCompleted NDBStopCompleted;
847  struct ndb_logevent_NDBStopForced NDBStopForced;
848  struct ndb_logevent_NDBStopAborted NDBStopAborted;
849  struct ndb_logevent_StartREDOLog StartREDOLog;
850  struct ndb_logevent_StartLog StartLog;
851  struct ndb_logevent_UNDORecordsExecuted UNDORecordsExecuted;
852  /* NODERESTART */
853  struct ndb_logevent_NR_CopyDict NR_CopyDict;
854  struct ndb_logevent_NR_CopyDistr NR_CopyDistr;
855  struct ndb_logevent_NR_CopyFragsStarted NR_CopyFragsStarted;
856  struct ndb_logevent_NR_CopyFragDone NR_CopyFragDone;
857  struct ndb_logevent_NR_CopyFragsCompleted NR_CopyFragsCompleted;
858  struct ndb_logevent_NodeFailCompleted NodeFailCompleted;
859  struct ndb_logevent_NODE_FAILREP NODE_FAILREP;
860  struct ndb_logevent_ArbitState ArbitState;
861  struct ndb_logevent_ArbitResult ArbitResult;
862  struct ndb_logevent_GCP_TakeoverStarted GCP_TakeoverStarted;
863  struct ndb_logevent_GCP_TakeoverCompleted GCP_TakeoverCompleted;
864  struct ndb_logevent_LCP_TakeoverStarted LCP_TakeoverStarted;
865  struct ndb_logevent_LCP_TakeoverCompleted LCP_TakeoverCompleted;
866  struct ndb_logevent_ConnectCheckStarted ConnectCheckStarted;
867  struct ndb_logevent_ConnectCheckCompleted ConnectCheckCompleted;
868  struct ndb_logevent_NodeFailRejected NodeFailRejected;
869 
870  /* STATISTIC */
871  struct ndb_logevent_TransReportCounters TransReportCounters;
872  struct ndb_logevent_OperationReportCounters OperationReportCounters;
873  struct ndb_logevent_TableCreated TableCreated;
874  struct ndb_logevent_JobStatistic JobStatistic;
875  struct ndb_logevent_SendBytesStatistic SendBytesStatistic;
876  struct ndb_logevent_ReceiveBytesStatistic ReceiveBytesStatistic;
877  struct ndb_logevent_MemoryUsage MemoryUsage;
878 
879  /* ERROR */
880  struct ndb_logevent_TransporterError TransporterError;
881  struct ndb_logevent_TransporterWarning TransporterWarning;
882  struct ndb_logevent_MissedHeartbeat MissedHeartbeat;
883  struct ndb_logevent_DeadDueToHeartbeat DeadDueToHeartbeat;
884  struct ndb_logevent_WarningEvent WarningEvent;
885 
886  /* INFO */
887  struct ndb_logevent_SentHeartbeat SentHeartbeat;
888  struct ndb_logevent_CreateLogBytes CreateLogBytes;
889  struct ndb_logevent_InfoEvent InfoEvent;
890  struct ndb_logevent_EventBufferStatus EventBufferStatus;
891  struct ndb_logevent_SavedEvent SavedEvent;
892 
925 
926  struct ndb_logevent_CreateSchemaObject CreateSchemaObject;
927  struct ndb_logevent_AlterSchemaObject AlterSchemaObject;
928  struct ndb_logevent_DropSchemaObject DropSchemaObject;
929  struct ndb_logevent_StartReadLCP StartReadLCP;
930  struct ndb_logevent_ReadLCPComplete ReadLCPComplete;
931  struct ndb_logevent_RunRedo RunRedo;
932  struct ndb_logevent_RebuildIndex RebuildIndex;
933 
935  unsigned Data[29];
936 #ifndef DOXYGEN_FIX
937  };
938 #else
939  } <union>;
940 #endif
941  };
942 
943 enum ndb_logevent_handle_error {
944  NDB_LEH_NO_ERROR,
945  NDB_LEH_READ_ERROR,
946  NDB_LEH_MISSING_EVENT_SPECIFIER,
947  NDB_LEH_UNKNOWN_EVENT_TYPE,
948  NDB_LEH_UNKNOWN_EVENT_VARIABLE,
949  NDB_LEH_INTERNAL_ERROR
950 };
951 
952 #ifdef __cplusplus
953 }
954 #endif
955 
958 #endif