37#ifndef log0constants_h
38#define log0constants_h
96 "A valid log size can be created with LOG_N_FILES");
207#define LOG_HEADER_CREATOR_CURRENT "MySQL " INNODB_VERSION_STR
210#define LOG_HEADER_CREATOR_CLONE "MySQL Clone"
305 "Header + footer cannot be larger than the whole log block.");
316 "Overhead in LSN sequence cannot be bigger than actual data.");
constexpr os_offset_t LOG_CHECKPOINT_LSN
Checkpoint lsn.
Definition: log0constants.h:241
constexpr sn_t SN_LOCKED
The sn bit to express locked state.
Definition: log0constants.h:158
constexpr uint32_t LOG_HEADER_FLAG_MAX
Maximum BIT position number.
Definition: log0constants.h:232
constexpr ulong INNODB_LOG_FLUSH_NOTIFIER_TIMEOUT_DEFAULT
Default value of innodb_log_flush_notifier_timeout (in microseconds).
Definition: log0constants.h:478
constexpr uint32_t LOG_AGGRESSIVE_CHECKPOINT_RATIO_MIN
Controls when the aggressive checkpointing should be started, with regards to the free space in the r...
Definition: log0constants.h:388
constexpr lsn_t LOG_START_LSN
The counting of lsn's starts from this value: this must be non-zero.
Definition: log0constants.h:149
constexpr uint32_t MLOG_TEST_REC_OVERHEAD
Bytes occupied by MLOG_TEST record with an empty payload.
Definition: log0constants.h:546
constexpr os_offset_t LOG_CHECKPOINT_1
First checkpoint field in the log header.
Definition: log0constants.h:163
constexpr uint32_t LOG_FILE_NAME_MAX_LENGTH
Maximum length of log file name, computed as: base name length(8)
Definition: log0constants.h:76
constexpr uint32_t LOG_BLOCK_FLUSH_BIT_MASK
Mask used to get the highest bit in the hdr_no field.
Definition: log0constants.h:253
constexpr ulint INNODB_LOG_WRITE_MAX_SIZE_DEFAULT
Default value of innodb_log_write_max_size (in bytes).
Definition: log0constants.h:409
constexpr uint32_t LOG_BLOCK_HDR_SIZE
Size of the log block's header in bytes.
Definition: log0constants.h:293
constexpr ulong INNODB_LOG_WRITE_AHEAD_SIZE_MIN
Minimum allowed value of innodb_log_write_ahead_size.
Definition: log0constants.h:520
constexpr const char *const LOG_FILE_BASE_NAME
Prefix of log file name in the current redo format.
Definition: log0constants.h:72
constexpr os_offset_t LOG_HEADER_CREATOR
A null-terminated string which will contain either the string 'MEB' and the MySQL version if the log ...
Definition: log0constants.h:193
constexpr ulong INNODB_LOG_EVENTS_MAX
Maximum allowed value of innodb_log_events.
Definition: log0constants.h:514
constexpr uint32_t LOG_BLOCK_HDR_DATA_LEN
Offset to number of bytes written to this block (also header bytes).
Definition: log0constants.h:259
constexpr os_offset_t LOG_FILE_MIN_SIZE
Minimum size of single log file, expressed in bytes.
Definition: log0constants.h:87
constexpr ulong INNODB_LOG_WAIT_FOR_WRITE_TIMEOUT_DEFAULT
Default value of innodb_log_wait_for_write_timeout (in microseconds).
Definition: log0constants.h:447
constexpr uint32_t LOG_BLOCK_DATA_SIZE
Size of log block's data fragment (where actual data is stored).
Definition: log0constants.h:308
constexpr double LOG_NEXT_FILE_EARLIER_MARGIN
Margin which is used ahead of log.write_lsn to create unused files earlier than the log....
Definition: log0constants.h:334
constexpr uint32_t LOG_HEADER_FLAG_NO_LOGGING
Flag at BIT-1 to indicate if redo logging is disabled or not.
Definition: log0constants.h:216
constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_MIN
Minimum allowed value of innodb_log_recent_closed_size.
Definition: log0constants.h:502
constexpr uint32_t LOG_HEADER_LOG_UUID
Offset within the log file header, to the field which stores the log_uuid.
Definition: log0constants.h:185
constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_DEFAULT
Default value of innodb_log_recent_written_size (in bytes).
Definition: log0constants.h:490
constexpr os_offset_t LOG_HEADER_ENCRYPTION_INFO_OFFSET
Offset to encryption information in the log encryption header.
Definition: log0constants.h:203
constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_DEFAULT
Default value of innodb_log_recent_closed_size (in bytes).
Definition: log0constants.h:499
constexpr uint32_t MLOG_TEST_MAX_REC_LEN
Maximum size of single MLOG_TEST record (in bytes).
Definition: log0constants.h:540
constexpr double LOG_CONCCURENCY_MARGIN_MAX_PCT
The maximum limit for concurrency_margin expressed as percentage of the redo capacity available for u...
Definition: log0constants.h:362
constexpr uint32_t LOG_BLOCK_FIRST_REC_GROUP
Offset to "first_rec_group offset" stored in the log block header.
Definition: log0constants.h:276
constexpr uint32_t LOG_HEADER_FLAG_NOT_INITIALIZED
Flag at BIT-3 to indicate if server is not recoverable on crash because data directory still has not ...
Definition: log0constants.h:225
constexpr os_offset_t LOG_CAPACITY_MAX
Maximum allowed value for innodb_redo_log_capacity.
Definition: log0constants.h:93
constexpr os_offset_t LOG_HEADER_CREATOR_END
End of the log file creator field (we add 1 for \0).
Definition: log0constants.h:199
constexpr os_offset_t LOG_FILE_MAX_SIZE
Maximum size of a log file, expressed in bytes.
Definition: log0constants.h:99
constexpr uint32_t LOG_BLOCK_HDR_NO
Offset to hdr_no, which is a log block number and must be > 0.
Definition: log0constants.h:249
constexpr lsn_t LSN_MAX
Maximum possible lsn value is slightly higher than the maximum sn value, because lsn sequence enumera...
Definition: log0constants.h:155
constexpr ulong INNODB_LOG_WRITE_AHEAD_SIZE_DEFAULT
Default value of innodb_log_write_ahead_size (in bytes).
Definition: log0constants.h:517
constexpr ulint INNODB_LOG_WRITE_AHEAD_SIZE_MAX
Maximum allowed value of innodb_log_write_ahead_size.
Definition: log0constants.h:523
constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_MIN
Minimum allowed value of innodb_log_recent_written_size.
Definition: log0constants.h:493
constexpr ulong INNODB_LOG_CHECKPOINT_EVERY_DEFAULT
Default value of innodb_log_checkpointer_every (in milliseconds).
Definition: log0constants.h:412
constexpr uint32_t LOG_BLOCK_EPOCH_NO
Offset to epoch_no stored in this log block.
Definition: log0constants.h:290
constexpr ulong INNODB_LOG_EVENTS_DEFAULT
Default value of innodb_log_events (number of events).
Definition: log0constants.h:508
constexpr os_offset_t LOG_FILE_HDR_SIZE
Size of log file's header.
Definition: log0constants.h:172
constexpr uint32_t LOG_FORCING_ADAPTIVE_FLUSH_RATIO_MIN
Controls when the speed of adaptive flushing of modified pages starts to increase.
Definition: log0constants.h:396
constexpr uint32_t LOG_NO_CHECKSUM_MAGIC
Magic value to use instead of log checksums when they are disabled.
Definition: log0constants.h:146
constexpr ulong INNODB_LOG_EVENTS_MIN
Minimum allowed value of innodb_log_events.
Definition: log0constants.h:511
constexpr ulong INNODB_LOG_WAIT_FOR_FLUSH_SPIN_DELAY_DEFAULT
Default value of innodb_log_wait_for_flush_spin_delay (in spin rounds).
Definition: log0constants.h:452
constexpr uint32_t LOG_HEADER_FLAG_FILE_FULL
Flag at BIT-4 to mark the redo log file as completely full and closed for any future writes.
Definition: log0constants.h:229
constexpr uint32_t LOG_BLOCK_ENCRYPT_BIT_MASK
Mask used to get the highest bit in the data len field, this bit is to indicate if this block is encr...
Definition: log0constants.h:263
constexpr os_offset_t LOG_CAPACITY_MIN
Minimum allowed value for innodb_redo_log_capacity.
Definition: log0constants.h:90
constexpr ulong INNODB_LOG_WRITE_NOTIFIER_TIMEOUT_DEFAULT
Default value of innodb_log_write_notifier_timeout (in microseconds).
Definition: log0constants.h:472
constexpr uint INNODB_LOG_SPIN_CPU_PCT_HWM_DEFAULT
Default value of innodb_log_spin_cpu_pct_hwm.
Definition: log0constants.h:432
constexpr ulong INNODB_LOG_FLUSH_NOTIFIER_SPIN_DELAY_DEFAULT
Default value of innodb_log_flush_notifier_spin_delay (in spin rounds).
Definition: log0constants.h:475
constexpr double LOG_EXTRA_CONC_MARGIN_PCT
Extra margin, reserved in the redo capacity for the concurrency margin.
Definition: log0constants.h:353
constexpr uint32_t LOG_FORCING_ADAPTIVE_FLUSH_RATIO_MAX
Controls when the maximum speed of adaptive flushing of modified pages is reached (with regards to fr...
Definition: log0constants.h:392
constexpr uint32_t LOG_FILES_DUMMY_INTAKE_SIZE
Number of bytes that might be generated by log_files_governor thread to fill up the current log file ...
Definition: log0constants.h:383
constexpr uint32_t LOG_BLOCK_TRL_SIZE
Size of the log block footer (trailer) in bytes.
Definition: log0constants.h:302
constexpr const char *const LOG_DIRECTORY_NAME
Name of subdirectory which contains redo log files.
Definition: log0constants.h:69
constexpr size_t LOG_N_FILES
Targeted number of log files.
Definition: log0constants.h:79
constexpr os_offset_t LOG_HEADER_SIZE
Current total size of LOG header.
Definition: log0constants.h:235
constexpr double LOG_N_FILES_MAX_DOWNSIZE_RATIO
Determines maximum downsize for maximum redo file size during resize.
Definition: log0constants.h:84
constexpr uint32_t LOG_BLOCK_MAX_NO
Maximum allowed block's number (stored in hdr_no) increased by 1.
Definition: log0constants.h:256
constexpr os_offset_t LOG_ENCRYPTION
Log Encryption information in redo log header.
Definition: log0constants.h:166
constexpr size_t LOG_BUFFER_ALIGNMENT
Align the log buffer (log_t::buf) to this size.
Definition: log0constants.h:52
constexpr uint32_t MLOG_TEST_GROUP_MAX_REC_N
Maximum number of MLOG_TEST records in single group of log records.
Definition: log0constants.h:543
constexpr uint32_t LOG_HEADER_FLAG_CRASH_UNSAFE
Flag at BIT-2 to indicate if server is not recoverable on crash.
Definition: log0constants.h:221
constexpr ulong INNODB_LOG_WAIT_FOR_FLUSH_SPIN_HWM_DEFAULT
Default value of innodb_log_wait_for_flush_spin_hwm (in microseconds).
Definition: log0constants.h:455
constexpr size_t LOG_HEADER_CREATOR_MAX_LENGTH
Maximum length of string with creator name (excludes \0).
Definition: log0constants.h:196
constexpr os_offset_t LOG_HEADER_FLAGS
32 BITs flag
Definition: log0constants.h:213
constexpr ulong INNODB_LOG_WRITER_SPIN_DELAY_DEFAULT
Default value of innodb_log_writer_spin_delay (in spin rounds).
Definition: log0constants.h:420
constexpr size_t LOG_WRITE_AHEAD_BUFFER_ALIGNMENT
Align the log write-ahead buffer (log_t::write_ahead_buf) to this size.
Definition: log0constants.h:57
constexpr int64_t MLOG_TEST_VALUE
Value to which MLOG_TEST records should sum up within a group.
Definition: log0constants.h:537
constexpr ulong INNODB_LOG_WAIT_FOR_FLUSH_TIMEOUT_DEFAULT
Default value of innodb_log_wait_for_flush_timeout (in microseconds).
Definition: log0constants.h:458
constexpr double LOG_EXTRA_WRITER_MARGIN_PCT
Extra margin, reserved in the redo capacity for the log writer thread.
Definition: log0constants.h:348
constexpr os_offset_t LOG_EXTRA_SAFETY_MARGIN
Extra safety margin in the redo capacity, never ever used !
Definition: log0constants.h:329
constexpr size_t LOG_BACKGROUND_THREADS_USING_RW_MTRS
Maximum number of concurrent background threads, that could be using mini transactions which are not ...
Definition: log0constants.h:370
constexpr ulong INNODB_LOG_WRITE_NOTIFIER_SPIN_DELAY_DEFAULT
Default value of innodb_log_write_notifier_spin_delay (in spin rounds).
Definition: log0constants.h:469
constexpr ulong INNODB_LOG_BUFFER_SIZE_MAX
Maximum allowed value of innodb_log_buffer_size.
Definition: log0constants.h:487
constexpr uint32_t LOG_BLOCK_CHECKSUM
4 byte checksum of the log block contents.
Definition: log0constants.h:299
constexpr os_offset_t LOG_HEADER_FORMAT
Log file header format identifier (32-bit unsigned big-endian integer).
Definition: log0constants.h:179
constexpr ulong INNODB_LOG_SPIN_CPU_ABS_LWM_DEFAULT
Default value of innodb_log_spin_cpu_abs_lwm.
Definition: log0constants.h:428
constexpr ulong INNODB_LOG_WAIT_FOR_WRITE_SPIN_DELAY_DEFAULT
Default value of innodb_log_wait_for_write_spin_delay (in spin rounds).
Definition: log0constants.h:444
constexpr ulong INNODB_LOG_BUFFER_SIZE_DEFAULT
Default value of innodb_log_buffer_size (in bytes).
Definition: log0constants.h:481
constexpr Log_file_id LOG_FIRST_FILE_ID
Id of the first redo log file (assigned to the first log file when new data directory is being initia...
Definition: log0constants.h:103
constexpr os_offset_t LOG_HEADER_START_LSN
LSN of the start of data in this log file (with format version 1 and 2).
Definition: log0constants.h:188
constexpr size_t LOG_MAX_OPEN_FILES
Maximum number of handles for opened redo log files (in parallel).
Definition: log0constants.h:131
constexpr ulong INNODB_LOG_FLUSHER_TIMEOUT_DEFAULT
Default value of innodb_log_flusher_timeout (in microseconds).
Definition: log0constants.h:466
constexpr uint32_t LOG_CHECKPOINT_FREE_PER_THREAD
Per thread margin for the free space in the log, before a new query step which modifies the database,...
Definition: log0constants.h:376
constexpr ulong INNODB_LOG_WRITER_TIMEOUT_DEFAULT
Default value of innodb_log_writer_timeout (in microseconds).
Definition: log0constants.h:424
constexpr os_offset_t LOG_CHECKPOINT_2
Second checkpoint field in the header of the first log file.
Definition: log0constants.h:169
constexpr ulong INNODB_LOG_FLUSHER_SPIN_DELAY_DEFAULT
Default value of innodb_log_flusher_spin_delay (in spin rounds).
Definition: log0constants.h:462
constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_MAX
Maximum allowed value of innodb_log_recent_written_size.
Definition: log0constants.h:496
constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_MAX
Maximum allowed value of innodb_log_recent_closed_size.
Definition: log0constants.h:505
constexpr ulong INNODB_LOG_BUFFER_SIZE_MIN
Minimum allowed value of innodb_log_buffer_size.
Definition: log0constants.h:484
size_t Log_file_id
Log file id (0 for ib_redo0)
Definition: log0types.h:65
uint64_t sn_t
Type used for sn values, which enumerate bytes of data stored in the log.
Definition: log0types.h:85
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:62
constexpr size_t INNODB_KERNEL_PAGE_SIZE_DEFAULT
Default kernel page size (not assuming huge pages support).
Definition: ut0cpu_cache.h:44
The interface to the operating system file io.
constexpr uint32_t OS_FILE_LOG_BLOCK_SIZE
The next value should be smaller or equal to the smallest sector size used on any disk.
Definition: os0file.h:192
uint64_t os_offset_t
File offset in bytes.
Definition: os0file.h:83
constexpr uint32_t UNIV_PAGE_SIZE_DEF
Default page size for InnoDB tablespaces.
Definition: univ.i:324
unsigned long int ulint
Definition: univ.i:405
constexpr size_t UNIV_PAGE_SIZE_MAX
Maximum page size InnoDB currently supports.
Definition: univ.i:322