40 #ifndef UNIV_HOTBACKUP
54 extern ibool log_debug_writes;
57 # define log_do_write TRUE
61 #define LOG_NO_WAIT 91
62 #define LOG_WAIT_ONE_GROUP 92
63 #define LOG_WAIT_ALL_GROUPS 93
66 #define LOG_MAX_N_GROUPS 32
68 #ifndef UNIV_HOTBACKUP
86 ib_int64_t* log_file_offset,
88 ib_uint64_t first_header_lsn,
94 ib_int64_t log_file_size);
96 #ifndef UNIV_HOTBACKUP
107 ib_uint64_t* start_lsn);
161 log_get_capacity(
void);
181 ulint archive_space_id);
207 ibool flush_to_disk);
236 ib_uint64_t new_oldest,
365 log_reset_first_header_and_checkpoint(
382 #ifndef UNIV_HOTBACKUP
392 ib_uint64_t start_lsn,
393 ib_uint64_t end_lsn);
404 ib_uint64_t start_lsn,
407 ulint new_data_offset);
439 const byte* log_block);
447 const byte* log_block);
455 const byte* log_block);
479 const byte* log_block);
496 const byte* log_block);
512 const byte* log_block);
572 extern log_t* log_sys;
575 #define LOG_FLUSH 7652559
576 #define LOG_CHECKPOINT 78656949
577 #ifdef UNIV_LOG_ARCHIVE
578 # define LOG_ARCHIVE 11122331
580 #define LOG_RECOVER 98887331
583 #define LOG_START_LSN ((ib_uint64_t) (16 * OS_FILE_LOG_BLOCK_SIZE))
585 #define LOG_BUFFER_SIZE (srv_log_buffer_size * UNIV_PAGE_SIZE)
586 #define LOG_ARCHIVE_BUF_SIZE (srv_log_buffer_size * UNIV_PAGE_SIZE / 4)
589 #define LOG_BLOCK_HDR_NO 0
594 #define LOG_BLOCK_FLUSH_BIT_MASK 0x80000000UL
597 #define LOG_BLOCK_HDR_DATA_LEN 4
599 #define LOG_BLOCK_FIRST_REC_GROUP 6
610 #define LOG_BLOCK_CHECKPOINT_NO 8
616 #define LOG_BLOCK_HDR_SIZE 12
620 #define LOG_BLOCK_CHECKSUM 4
625 #define LOG_BLOCK_TRL_SIZE 4
628 #define LOG_CHECKPOINT_NO 0
629 #define LOG_CHECKPOINT_LSN 8
630 #define LOG_CHECKPOINT_OFFSET 16
631 #define LOG_CHECKPOINT_LOG_BUF_SIZE 20
632 #define LOG_CHECKPOINT_ARCHIVED_LSN 24
633 #define LOG_CHECKPOINT_GROUP_ARRAY 32
637 #define LOG_CHECKPOINT_ARCHIVED_FILE_NO 0
638 #define LOG_CHECKPOINT_ARCHIVED_OFFSET 4
640 #define LOG_CHECKPOINT_ARRAY_END (LOG_CHECKPOINT_GROUP_ARRAY\
641 + LOG_MAX_N_GROUPS * 8)
642 #define LOG_CHECKPOINT_CHECKSUM_1 LOG_CHECKPOINT_ARRAY_END
643 #define LOG_CHECKPOINT_CHECKSUM_2 (4 + LOG_CHECKPOINT_ARRAY_END)
644 #define LOG_CHECKPOINT_FSP_FREE_LIMIT (8 + LOG_CHECKPOINT_ARRAY_END)
652 #define LOG_CHECKPOINT_FSP_MAGIC_N (12 + LOG_CHECKPOINT_ARRAY_END)
657 #define LOG_CHECKPOINT_SIZE (16 + LOG_CHECKPOINT_ARRAY_END)
659 #define LOG_CHECKPOINT_FSP_MAGIC_N_VAL 1441231243
662 #define LOG_GROUP_ID 0
663 #define LOG_FILE_START_LSN 4
665 #define LOG_FILE_NO 12
668 #define LOG_FILE_WAS_CREATED_BY_HOT_BACKUP 16
676 #define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
679 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
684 #define LOG_FILE_END_LSN (OS_FILE_LOG_BLOCK_SIZE + 4)
692 #define LOG_CHECKPOINT_1 OS_FILE_LOG_BLOCK_SIZE
698 #define LOG_CHECKPOINT_2 (3 * OS_FILE_LOG_BLOCK_SIZE)
701 #define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)
703 #define LOG_GROUP_OK 301
704 #define LOG_GROUP_CORRUPTED 302
726 #ifdef UNIV_LOG_ARCHIVE
728 byte** archive_file_header_bufs_ptr;
729 byte** archive_file_header_bufs;
731 ulint archive_space_id;
734 ulint archived_file_no;
736 ulint archived_offset;
740 ulint next_archived_file_no;
746 ulint next_archived_offset;
767 #ifndef UNIV_HOTBACKUP
791 ibool check_flush_or_checkpoint;
803 #ifndef UNIV_HOTBACKUP
806 ulint buf_next_to_write;
813 ib_uint64_t written_to_some_lsn;
819 ib_uint64_t written_to_all_lsn;
835 ib_uint64_t write_lsn;
837 ulint write_end_offset;
842 ib_uint64_t current_flush_lsn;
844 ib_uint64_t flushed_to_disk_lsn;
876 time_t last_printout_time;
881 ulint log_group_capacity;
886 ulint max_modified_age_async;
892 ulint max_modified_age_sync;
898 ulint adm_checkpoint_interval;
903 ulint max_checkpoint_age_async;
908 ulint max_checkpoint_age;
912 ib_uint64_t next_checkpoint_no;
914 ib_uint64_t last_checkpoint_lsn;
916 ib_uint64_t next_checkpoint_lsn;
918 ulint n_pending_checkpoint_writes;
930 #ifdef UNIV_LOG_ARCHIVE
932 ulint archiving_state;
934 ib_uint64_t archived_lsn;
936 ulint max_archived_lsn_age_async;
940 ulint max_archived_lsn_age;
943 ib_uint64_t next_archived_lsn;
949 ulint archiving_phase;
951 ulint n_pending_archive_ios;
958 ulint archive_buf_size;
969 #define log_flush_order_mutex_own() \
970 mutex_own(&log_sys->log_flush_order_mutex)
973 #define log_flush_order_mutex_enter() do { \
974 mutex_enter(&log_sys->log_flush_order_mutex); \
977 # define log_flush_order_mutex_exit() do { \
978 mutex_exit(&log_sys->log_flush_order_mutex); \
981 #ifdef UNIV_LOG_ARCHIVE
983 #define LOG_ARCH_ON 71
984 #define LOG_ARCH_STOPPING 72
985 #define LOG_ARCH_STOPPING2 73
986 #define LOG_ARCH_STOPPED 74
987 #define LOG_ARCH_OFF 75
992 #include "log0log.ic"