39 #ifndef UNIV_HOTBACKUP
45 typedef ib_uint64_t lsn_t;
46 #define LSN_MAX IB_UINT64_MAX
48 #define LSN_PF UINT64PF
62 # define log_do_write TRUE
66 #define LOG_NO_WAIT 91
67 #define LOG_WAIT_ONE_GROUP 92
68 #define LOG_WAIT_ALL_GROUPS 93
71 #define LOG_MAX_N_GROUPS 32
80 ib_int64_t* log_file_offset,
82 ib_uint64_t first_header_lsn,
88 ib_int64_t log_file_size);
90 #ifndef UNIV_HOTBACKUP
155 log_get_capacity(
void);
163 log_get_max_modified_age_async(
void);
183 ulint archive_space_id);
208 ibool flush_to_disk);
351 log_reset_first_header_and_checkpoint(
368 #ifndef UNIV_HOTBACKUP
393 ulint new_data_offset);
425 const byte* log_block);
433 const byte* log_block);
441 const byte* log_block);
465 const byte* log_block);
482 const byte* log_block);
498 const byte* log_block);
564 extern log_t* log_sys;
567 #define LOG_FLUSH 7652559
568 #define LOG_CHECKPOINT 78656949
569 #ifdef UNIV_LOG_ARCHIVE
570 # define LOG_ARCHIVE 11122331
572 #define LOG_RECOVER 98887331
575 #define LOG_START_LSN ((lsn_t) (16 * OS_FILE_LOG_BLOCK_SIZE))
577 #define LOG_BUFFER_SIZE (srv_log_buffer_size * UNIV_PAGE_SIZE)
578 #define LOG_ARCHIVE_BUF_SIZE (srv_log_buffer_size * UNIV_PAGE_SIZE / 4)
581 #define LOG_BLOCK_HDR_NO 0
586 #define LOG_BLOCK_FLUSH_BIT_MASK 0x80000000UL
589 #define LOG_BLOCK_HDR_DATA_LEN 4
591 #define LOG_BLOCK_FIRST_REC_GROUP 6
602 #define LOG_BLOCK_CHECKPOINT_NO 8
608 #define LOG_BLOCK_HDR_SIZE 12
612 #define LOG_BLOCK_CHECKSUM 4
617 #define LOG_BLOCK_TRL_SIZE 4
620 #define LOG_CHECKPOINT_NO 0
621 #define LOG_CHECKPOINT_LSN 8
622 #define LOG_CHECKPOINT_OFFSET_LOW32 16
623 #define LOG_CHECKPOINT_LOG_BUF_SIZE 20
624 #define LOG_CHECKPOINT_ARCHIVED_LSN 24
625 #define LOG_CHECKPOINT_GROUP_ARRAY 32
629 #define LOG_CHECKPOINT_ARCHIVED_FILE_NO 0
630 #define LOG_CHECKPOINT_ARCHIVED_OFFSET 4
632 #define LOG_CHECKPOINT_ARRAY_END (LOG_CHECKPOINT_GROUP_ARRAY\
633 + LOG_MAX_N_GROUPS * 8)
634 #define LOG_CHECKPOINT_CHECKSUM_1 LOG_CHECKPOINT_ARRAY_END
635 #define LOG_CHECKPOINT_CHECKSUM_2 (4 + LOG_CHECKPOINT_ARRAY_END)
637 #define LOG_CHECKPOINT_FSP_FREE_LIMIT (8 + LOG_CHECKPOINT_ARRAY_END)
652 #define LOG_CHECKPOINT_FSP_MAGIC_N (12 + LOG_CHECKPOINT_ARRAY_END)
659 #define LOG_CHECKPOINT_FSP_MAGIC_N_VAL 1441231243
665 #define LOG_CHECKPOINT_OFFSET_HIGH32 (16 + LOG_CHECKPOINT_ARRAY_END)
666 #define LOG_CHECKPOINT_SIZE (20 + LOG_CHECKPOINT_ARRAY_END)
670 #define LOG_GROUP_ID 0
671 #define LOG_FILE_START_LSN 4
673 #define LOG_FILE_NO 12
676 #define LOG_FILE_WAS_CREATED_BY_HOT_BACKUP 16
684 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
689 #define LOG_FILE_END_LSN (OS_FILE_LOG_BLOCK_SIZE + 4)
697 #define LOG_CHECKPOINT_1 OS_FILE_LOG_BLOCK_SIZE
703 #define LOG_CHECKPOINT_2 (3 * OS_FILE_LOG_BLOCK_SIZE)
706 #define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)
708 #define LOG_GROUP_OK 301
709 #define LOG_GROUP_CORRUPTED 302
731 #ifdef UNIV_LOG_ARCHIVE
733 byte** archive_file_header_bufs_ptr;
734 byte** archive_file_header_bufs;
736 ulint archive_space_id;
739 ulint archived_file_no;
741 ulint archived_offset;
745 ulint next_archived_file_no;
751 ulint next_archived_offset;
772 #ifndef UNIV_HOTBACKUP
790 #ifdef UNIV_LOG_DEBUG
798 ibool check_flush_or_checkpoint;
810 #ifndef UNIV_HOTBACKUP
813 ulint buf_next_to_write;
820 volatile bool is_extending;
822 lsn_t written_to_some_lsn;
828 lsn_t written_to_all_lsn;
846 ulint write_end_offset;
851 lsn_t current_flush_lsn;
853 lsn_t flushed_to_disk_lsn;
885 time_t last_printout_time;
890 lsn_t log_group_capacity;
895 lsn_t max_modified_age_async;
901 lsn_t max_modified_age_sync;
907 lsn_t max_checkpoint_age_async;
912 lsn_t max_checkpoint_age;
916 ib_uint64_t next_checkpoint_no;
918 lsn_t last_checkpoint_lsn;
920 lsn_t next_checkpoint_lsn;
922 ulint n_pending_checkpoint_writes;
934 #ifdef UNIV_LOG_ARCHIVE
936 ulint archiving_state;
940 lsn_t max_archived_lsn_age_async;
944 lsn_t max_archived_lsn_age;
947 lsn_t next_archived_lsn;
953 ulint archiving_phase;
955 ulint n_pending_archive_ios;
962 ulint archive_buf_size;
973 #define log_flush_order_mutex_own() \
974 mutex_own(&log_sys->log_flush_order_mutex)
977 #define log_flush_order_mutex_enter() do { \
978 mutex_enter(&log_sys->log_flush_order_mutex); \
981 # define log_flush_order_mutex_exit() do { \
982 mutex_exit(&log_sys->log_flush_order_mutex); \
985 #ifdef UNIV_LOG_ARCHIVE
987 #define LOG_ARCH_ON 71
988 #define LOG_ARCH_STOPPING 72
989 #define LOG_ARCH_STOPPING2 73
990 #define LOG_ARCH_STOPPED 74
991 #define LOG_ARCH_OFF 75