MySQL 8.0.31
Source Code Documentation
log0constants.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1995, 2022, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is also distributed with certain software (including but not
10limited to OpenSSL) that is licensed under separate terms, as designated in a
11particular file or component or in included license documentation. The authors
12of MySQL hereby grant you an additional permission to link the program and
13your derivative works with the separately licensed software that they have
14included with MySQL.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25*****************************************************************************/
26
27/**************************************************/ /**
28 @file include/log0constants.h
29
30 Redo log constant values. This file should not be included
31 except the include in log0types.h.
32
33 Include log0types.h if you needed to use constants.
34
35 *******************************************************/
36
37#ifndef log0constants_h
38#define log0constants_h
39
40/* lsn_t, sn_t, Log_file_id */
41#include "log0types.h"
42
43/* os_offset_t, OS_FILE_LOG_BLOCK_SIZE */
44#include "os0file.h"
45
46/** Align the log buffer (log_t::buf) to this size. This is to preserve the
47compatibility with older MySQL versions which also aligned the log buffer
48to OS_FILE_LOG_BLOCK_SIZE. Note, that each write from the log buffer starts
49at the beginning of one of the blocks in this buffer i.e. from address being
50a multiple of OS_FILE_LOG_BLOCK_SIZE. Therefore any bigger value for alignment
51here does not make sense. Please do not use this constant for other buffers. */
53
54/** Align the log write-ahead buffer (log_t::write_ahead_buf) to this size.
55This increases chance that the write-ahead buffer is spanned over smaller
56number of memory pages. Please do not use this constant for other buffers. */
59
60/**************************************************/ /**
61
62 @name Log constants related to the log file i-nodes.
63
64 *******************************************************/
65
66/** @{ */
67
68/** Name of subdirectory which contains redo log files. */
69constexpr const char *const LOG_DIRECTORY_NAME = "#innodb_redo";
70
71/** Prefix of log file name in the current redo format. */
72constexpr const char *const LOG_FILE_BASE_NAME = "#ib_redo";
73
74/** Maximum length of log file name, computed as: base name length(8)
75+ length for decimal digits(22). */
76constexpr uint32_t LOG_FILE_NAME_MAX_LENGTH = 8 + 22;
77
78/** Targeted number of log files. */
79constexpr size_t LOG_N_FILES = 32;
80
81/** Determines maximum downsize for maximum redo file size during resize.
82If maximum file size is 8G, then 1.0/8 means, that InnoDB needs to first
83achieve maximum file size equal to 1G before targeting even lower values. */
84constexpr double LOG_N_FILES_MAX_DOWNSIZE_RATIO = 1.0 / 8;
85
86/** Minimum size of single log file, expressed in bytes. */
87constexpr os_offset_t LOG_FILE_MIN_SIZE = 64 * 1024;
88
89/** Maximum size of single log file, expressed in bytes. */
90constexpr os_offset_t LOG_FILE_MAX_SIZE = 4ULL * 1024 * 1024 * 1024; /* 4G */
91
92/** Minimum allowed value for innodb_redo_log_capacity. */
93constexpr os_offset_t LOG_CAPACITY_MIN = 8 * 1024 * 1024; /* 8M */
94
95/** Maximum allowed value for innodb_redo_log_capacity. */
97
98/** Id of the first redo log file (assigned to the first log file
99when new data directory is being initialized). */
101
102/** Maximum number of handles for opened redo log files (in parallel).
103The following handles for opened files have been identified during runtime:
104 - protected by the log_writer_mutex and the log_flusher_mutex:
105 - log_writer() and log_flusher() use log.m_current_file_handle
106 and this handle represents one file and can only be switched
107 to the next file if both mutexes are acquired,
108 - if redo log file is being rewritten, the read_handle for the old
109 file acts on behalf of m_current_file_handle which is closed before
110 the read_handle is opened.
111 - protected by the log_files_mutex:
112 - log_files_next_checkpoint() uses handle on stack,
113 - log_files_prepare_unused_file() uses handle on stack,
114 - log_encryption_write_low() uses handle on stack,
115 - if redo log file is being rewritten, the write_handle for the new
116 file uses this slot (protected by the files_mutex); it is opened
117 after log_files_prepare_unused_file() closed its handle.
118During startup - in main thread (recv functions):
119 - log_files_find_and_analyze() uses handle on stack,
120 - recv_log_recover_pre_8_0_30() uses handle on stack,
121 - recv_find_max_checkpoint() uses handle on stack,
122 - recv_read_log_seg() uses handle on stack,
123 - recv_recovery_from_checkpoint_start() uses handle on stack but
124 after the recv_find_max_checkpoint() is finished and before
125 the recv_read_log_seg() is started.
126Redo threads are started after the recv_recovery_from_checkpoint_start() is
127finished, so they don't use handle in parallel with these recv functions. */
128constexpr size_t LOG_MAX_OPEN_FILES = 2;
129
130/** @} */
131
132/**************************************************/ /**
133
134 @name Log constants related to the log file format.
135
136 *******************************************************/
137
138/** @{ */
139
140/* General constants describing the log file format. */
141
142/** Magic value to use instead of log checksums when they are disabled. */
143constexpr uint32_t LOG_NO_CHECKSUM_MAGIC = 0xDEADBEEFUL;
144
145/** The counting of lsn's starts from this value: this must be non-zero. */
147
148/** Maximum possible lsn value is slightly higher than the maximum sn value,
149because lsn sequence enumerates also bytes used for headers and footers of
150all log blocks. However, still 64-bits are enough to represent the maximum
151lsn value, because only 63 bits are used to represent sn value. */
152constexpr lsn_t LSN_MAX = (1ULL << 63) - 1;
153
154/** The sn bit to express locked state. */
155constexpr sn_t SN_LOCKED = 1ULL << 63;
156
157/** First checkpoint field in the log header. We write alternately to
158the checkpoint fields when we make new checkpoints. This field is only
159defined in the first log file. */
161
162/** Log Encryption information in redo log header. */
164
165/** Second checkpoint field in the header of the first log file. */
167
168/** Size of log file's header. */
170
171/* Offsets used in a log file header */
172
173/** Log file header format identifier (32-bit unsigned big-endian integer).
174This used to be called LOG_GROUP_ID and always written as 0,
175because InnoDB never supported more than one copy of the redo log. */
177
178/** Offset within the log file header, to the field which stores the log_uuid.
179The log_uuid is chosen after a new data directory is initialized, and allows
180to detect situation, in which some of log files came from other data directory
181(detection is performed on startup, before starting recovery). */
182constexpr uint32_t LOG_HEADER_LOG_UUID = 4;
183
184/** LSN of the start of data in this log file (with format version 1 and 2). */
186
187/** A null-terminated string which will contain either the string 'MEB'
188and the MySQL version if the log file was created by mysqlbackup,
189or 'MySQL' and the MySQL version that created the redo log file. */
191
192/** Maximum length of string with creator name (excludes \0). */
193constexpr size_t LOG_HEADER_CREATOR_MAX_LENGTH = 31;
194
195/** End of the log file creator field (we add 1 for \0). */
198
199/** Offset to encryption information in the log encryption header. */
202
203/** Contents of the LOG_HEADER_CREATOR field */
204#define LOG_HEADER_CREATOR_CURRENT "MySQL " INNODB_VERSION_STR
205
206/** Header is created during DB clone */
207#define LOG_HEADER_CREATOR_CLONE "MySQL Clone"
208
209/** 32 BITs flag */
211
212/** Flag at BIT-1 to indicate if redo logging is disabled or not. */
213constexpr uint32_t LOG_HEADER_FLAG_NO_LOGGING = 1;
214
215/** Flag at BIT-2 to indicate if server is not recoverable on crash. This
216is set only when redo logging is disabled and unset on slow shutdown after
217all pages are flushed to disk. */
218constexpr uint32_t LOG_HEADER_FLAG_CRASH_UNSAFE = 2;
219
220/** Flag at BIT-3 to indicate if server is not recoverable on crash because
221data directory still has not been fully initialized. */
222constexpr uint32_t LOG_HEADER_FLAG_NOT_INITIALIZED = 3;
223
224/** Flag at BIT-4 to mark the redo log file as completely full and closed
225for any future writes. */
226constexpr uint32_t LOG_HEADER_FLAG_FILE_FULL = 4;
227
228/** Maximum BIT position number. Should be set to the latest added. */
230
231/** Current total size of LOG header. */
233
234/* Offsets inside the checkpoint pages since 8.0.30 redo format. */
235
236/** Checkpoint lsn. Recovery starts from this lsn and searches for the first
237log record group that starts since then. */
239
240/* Offsets used in a log block header. */
241
242/** Offset to hdr_no, which is a log block number and must be > 0.
243It is allowed to wrap around at LOG_BLOCK_MAX_NO.
244In older versions of MySQL the highest bit (LOG_BLOCK_FLUSH_BIT_MASK) of hdr_no
245is set to 1, if this is the first block in a call to write. */
246constexpr uint32_t LOG_BLOCK_HDR_NO = 0;
247
248/** Mask used to get the highest bit in the hdr_no field.
249In the older MySQL versions this bit was used to mark first block in a write.*/
250constexpr uint32_t LOG_BLOCK_FLUSH_BIT_MASK = 0x80000000UL;
251
252/** Maximum allowed block's number (stored in hdr_no) increased by 1. */
253constexpr uint32_t LOG_BLOCK_MAX_NO = 0x3FFFFFFFUL + 1;
254
255/** Offset to number of bytes written to this block (also header bytes). */
256constexpr uint32_t LOG_BLOCK_HDR_DATA_LEN = 4;
257
258/** Mask used to get the highest bit in the data len field,
259this bit is to indicate if this block is encrypted or not. */
260constexpr uint32_t LOG_BLOCK_ENCRYPT_BIT_MASK = 0x8000UL;
261
262/** Offset to "first_rec_group offset" stored in the log block header.
263
264The first_rec_group offset is an offset of the first start of mtr log
265record group in this log block (0 if no mtr starts in that log block).
266
267If the value is the same as LOG_BLOCK_HDR_DATA_LEN, it means that the
268first rec group has not yet been concatenated to this log block, but if
269it was supposed to be appended, it would start at this offset.
270
271An archive recovery can start parsing the log records starting from this
272offset in this log block, if value is not 0. */
273constexpr uint32_t LOG_BLOCK_FIRST_REC_GROUP = 6;
274
275/** Offset to epoch_no stored in this log block. The epoch_no is computed
276as the number of epochs passed by the value of start_lsn of the log block.
277Single epoch is defined as range of lsn values containing LOG_BLOCK_MAX_NO
278log blocks, each of OS_FILE_LOG_BLOCK_SIZE bytes. Note, that hdr_no stored
279in header of log block at offset=LOG_BLOCK_HDR_NO, can address the block
280within a given epoch, whereas epoch_no stored at offset=LOG_BLOCK_EPOCH_NO
281is the number of full epochs that were before. The pair <epoch_no, hdr_no>
282would be the absolute block number, so the epoch_no helps in discovery of
283unexpected end of the log during recovery in similar way as hdr_no does.
284@remarks The epoch_no for block that starts at start_lsn is computed as
285the start_lsn divided by OS_FILE_LOG_BLOCK_SIZE, and then divided by the
286LOG_BLOCK_MAX_NO. */
287constexpr uint32_t LOG_BLOCK_EPOCH_NO = 8;
288
289/** Size of the log block's header in bytes. */
290constexpr uint32_t LOG_BLOCK_HDR_SIZE = 12;
291
292/* Offsets used in a log block's footer (refer to the end of the block). */
293
294/** 4 byte checksum of the log block contents. In InnoDB versions < 3.23.52
295this did not contain the checksum, but the same value as .._HDR_NO. */
296constexpr uint32_t LOG_BLOCK_CHECKSUM = 4;
297
298/** Size of the log block footer (trailer) in bytes. */
299constexpr uint32_t LOG_BLOCK_TRL_SIZE = 4;
300
302 "Header + footer cannot be larger than the whole log block.");
303
304/** Size of log block's data fragment (where actual data is stored). */
305constexpr uint32_t LOG_BLOCK_DATA_SIZE =
307
308/** Ensure, that 64 bits are enough to represent lsn values, when 63 bits
309are used to represent sn values. It is enough to ensure that lsn < 2*sn,
310and that is guaranteed if the overhead enumerated in lsn sequence is not
311bigger than number of actual data bytes. */
313 "Overhead in LSN sequence cannot be bigger than actual data.");
314
315/** @} */
316
317/**************************************************/ /**
318
319 @name Log constants related to the log margins.
320
321 *******************************************************/
322
323/** @{ */
324
325/** Extra safety margin in the redo capacity, never ever used ! */
327
328/** Margin which is used ahead of log.write_lsn to create unused files earlier
329than the log.write_lsn reaches the m_end_lsn of the log.m_current_file. This
330margin is expressed in percentage of the next file size. */
331constexpr double LOG_NEXT_FILE_EARLIER_MARGIN = 10;
332
333/** Extra margin, reserved in the redo capacity for the log writer thread.
334When checkpoint age exceeds its maximum limits and user threads are waiting
335in log_free_check() calls, the log writer thread still has "extra margin"
336space reserved in the log files (it is his private fragment of the redo log,
337not announced to users of the redo log). When that happens, all user threads
338are paused at log_free_check.
339This mechanism is supposed to help with getting out of possible deadlocks
340between mini-transactions holding latched pages and page cleaners trying to
341reclaim space in the redo log by flushing the oldest modified pages. It is
342supposed to help if the innodb_thread_concurrency is unlimited or we missed
343to do some log_free_check() calls. This margin is expressed in percentage of
344the total redo capacity available for the log writer thread (hard capacity). */
345constexpr double LOG_EXTRA_WRITER_MARGIN_PCT = 5; /* 5% */
346
347/** Extra margin, reserved in the redo capacity for the concurrency margin.
348Expressed in percentage of the total redo capacity available for user threads
349(soft capacity). Excluded from LOG_CONCCURENCY_MARGIN_MAX_PCT. */
350constexpr double LOG_EXTRA_CONC_MARGIN_PCT = 5; /* 5% */
351
352/** The maximum limit for concurrency_margin expressed as percentage of the
353redo capacity available for user threads (soft capacity).
354
355@remarks The concurrency margin is computed as the maximum number of concurrent
356threads multiplied by some fixed size. Therefore it could happen that it would
357be even bigger than the redo capacity. To avoid such problem, we need to limit
358the concurrency margin and warn if the limitation is hit. */
359constexpr double LOG_CONCCURENCY_MARGIN_MAX_PCT = 50; /* 50% */
360
361/** Maximum number of concurrent background threads, that could be using mini
362transactions which are not read-only (producing redo log records). These are
363threads, which also call log_free_check() to reserve space in the redo log,
364but which are not included in the innodb_thread_concurrency limitation. That's
365why this number is added to the innodb_thread_concurrency when computing the
366concurrency_margin, which is used in log_free_check() calls. */
368
369/** Per thread margin for the free space in the log, before a new query step
370which modifies the database, is started. It's multiplied by maximum number
371of threads, that can concurrently enter mini-transactions. Expressed in
372number of pages. */
373constexpr uint32_t LOG_CHECKPOINT_FREE_PER_THREAD = 4;
374
375/** Number of bytes that might be generated by log_files_governor thread
376to fill up the current log file faster. Note that before generating those
377bytes, the log_files_governor checks if log_free_check is required:
378- no: acts as automatic reservation of space for the records to generate,
379- yes: it skips the redo records generation in this round */
380constexpr uint32_t LOG_FILES_DUMMY_INTAKE_SIZE = 4 * 1024;
381
382/** Controls when the aggressive checkpointing should be started,
383with regards to the free space in the redo log.
384Should be bigger than LOG_FORCING_ADAPTIVE_FLUSH_RATIO_MAX. */
386
387/** Controls when the maximum speed of adaptive flushing of modified pages
388is reached (with regards to free space in the redo log). */
390
391/** Controls when the speed of adaptive flushing of modified pages starts to
392increase. Should be less than the LOG_FORCING_ADAPTIVE_FLUSH_RATIO_MAX. */
394
395/** @} */
396
397/**************************************************/ /**
398
399 @name Log constants related to the system variables.
400
401 *******************************************************/
402
403/** @{ */
404
405/** Default value of innodb_log_write_max_size (in bytes). */
407
408/** Default value of innodb_log_checkpointer_every (in milliseconds). */
409constexpr ulong INNODB_LOG_CHECKPOINT_EVERY_DEFAULT = 1000; // 1000ms = 1s
410
411/** Default value of innodb_log_writer_spin_delay (in spin rounds).
412We measured that 1000 spin round takes 4us. We decided to select 1ms
413as the maximum time for busy waiting. Therefore it corresponds to 250k
414spin rounds. Note that first wait on event takes 50us-100us (even if 10us
415is passed), so it is 5%-10% of the total time that we have already spent
416on busy waiting, when we fall back to wait on event. */
418
419/** Default value of innodb_log_writer_timeout (in microseconds).
420Note that it will anyway take at least 50us. */
422
423/** Default value of innodb_log_spin_cpu_abs_lwm.
424Expressed in percent (80 stands for 80%) of a single CPU core. */
426
427/** Default value of innodb_log_spin_cpu_pct_hwm.
428Expressed in percent (50 stands for 50%) of all CPU cores. */
430
431/** Default value of innodb_log_wait_for_write_spin_delay (in spin rounds).
432Read about INNODB_LOG_WRITER_SPIN_DELAY_DEFAULT.
433Number of spin rounds is calculated according to current usage of CPU cores.
434If the usage is smaller than lwm percents of single core, then max rounds = 0.
435If the usage is smaller than 50% of hwm percents of all cores, then max rounds
436is decreasing linearly from 10x innodb_log_writer_spin_delay to 1x (for 50%).
437Then in range from 50% of hwm to 100% of hwm, the max rounds stays equal to
438the innodb_log_writer_spin_delay, because it doesn't make sense to use too
439short waits. Hence this is minimum value for the max rounds when non-zero
440value is being used. */
442
443/** Default value of innodb_log_wait_for_write_timeout (in microseconds). */
445
446/** Default value of innodb_log_wait_for_flush_spin_delay (in spin rounds).
447Read about INNODB_LOG_WAIT_FOR_WRITE_SPIN_DELAY_DEFAULT. The same mechanism
448applies here (to compute max rounds). */
450
451/** Default value of innodb_log_wait_for_flush_spin_hwm (in microseconds). */
453
454/** Default value of innodb_log_wait_for_flush_timeout (in microseconds). */
456
457/** Default value of innodb_log_flusher_spin_delay (in spin rounds).
458Read about INNODB_LOG_WRITER_SPIN_DELAY_DEFAULT. */
460
461/** Default value of innodb_log_flusher_timeout (in microseconds).
462Note that it will anyway take at least 50us. */
464
465/** Default value of innodb_log_write_notifier_spin_delay (in spin rounds). */
467
468/** Default value of innodb_log_write_notifier_timeout (in microseconds). */
470
471/** Default value of innodb_log_flush_notifier_spin_delay (in spin rounds). */
473
474/** Default value of innodb_log_flush_notifier_timeout (in microseconds). */
476
477/** Default value of innodb_log_buffer_size (in bytes). */
478constexpr ulong INNODB_LOG_BUFFER_SIZE_DEFAULT = 16 * 1024 * 1024UL;
479
480/** Minimum allowed value of innodb_log_buffer_size. */
481constexpr ulong INNODB_LOG_BUFFER_SIZE_MIN = 256 * 1024UL;
482
483/** Maximum allowed value of innodb_log_buffer_size. */
484constexpr ulong INNODB_LOG_BUFFER_SIZE_MAX = ULONG_MAX;
485
486/** Default value of innodb_log_recent_written_size (in bytes). */
487constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_DEFAULT = 1024 * 1024;
488
489/** Minimum allowed value of innodb_log_recent_written_size. */
491
492/** Maximum allowed value of innodb_log_recent_written_size. */
493constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_MAX = 1024 * 1024 * 1024UL;
494
495/** Default value of innodb_log_recent_closed_size (in bytes). */
496constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_DEFAULT = 2 * 1024 * 1024;
497
498/** Minimum allowed value of innodb_log_recent_closed_size. */
500
501/** Maximum allowed value of innodb_log_recent_closed_size. */
502constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_MAX = 1024 * 1024 * 1024UL;
503
504/** Default value of innodb_log_events (number of events). */
505constexpr ulong INNODB_LOG_EVENTS_DEFAULT = 2048;
506
507/** Minimum allowed value of innodb_log_events. */
508constexpr ulong INNODB_LOG_EVENTS_MIN = 1;
509
510/** Maximum allowed value of innodb_log_events. */
511constexpr ulong INNODB_LOG_EVENTS_MAX = 1024 * 1024 * 1024UL;
512
513/** Default value of innodb_log_write_ahead_size (in bytes). */
515
516/** Minimum allowed value of innodb_log_write_ahead_size. */
518
519/** Maximum allowed value of innodb_log_write_ahead_size. */
521 UNIV_PAGE_SIZE_DEF; // 16kB...
522
523/** @} */
524
525/**************************************************/ /**
526
527 @name Log constants used in the tests of the redo log.
528
529 *******************************************************/
530
531/** @{ */
532
533/** Value to which MLOG_TEST records should sum up within a group. */
534constexpr int64_t MLOG_TEST_VALUE = 10000;
535
536/** Maximum size of single MLOG_TEST record (in bytes). */
537constexpr uint32_t MLOG_TEST_MAX_REC_LEN = 100;
538
539/** Maximum number of MLOG_TEST records in single group of log records. */
540constexpr uint32_t MLOG_TEST_GROUP_MAX_REC_N = 100;
541
542/** Bytes occupied by MLOG_TEST record with an empty payload. */
543constexpr uint32_t MLOG_TEST_REC_OVERHEAD = 37;
544
545/** @} */
546
547#endif /* !log0constants_h */
constexpr os_offset_t LOG_CHECKPOINT_LSN
Checkpoint lsn.
Definition: log0constants.h:238
constexpr sn_t SN_LOCKED
The sn bit to express locked state.
Definition: log0constants.h:155
constexpr uint32_t LOG_HEADER_FLAG_MAX
Maximum BIT position number.
Definition: log0constants.h:229
constexpr ulong INNODB_LOG_FLUSH_NOTIFIER_TIMEOUT_DEFAULT
Default value of innodb_log_flush_notifier_timeout (in microseconds).
Definition: log0constants.h:475
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:385
constexpr lsn_t LOG_START_LSN
The counting of lsn's starts from this value: this must be non-zero.
Definition: log0constants.h:146
constexpr uint32_t MLOG_TEST_REC_OVERHEAD
Bytes occupied by MLOG_TEST record with an empty payload.
Definition: log0constants.h:543
constexpr os_offset_t LOG_CHECKPOINT_1
First checkpoint field in the log header.
Definition: log0constants.h:160
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:250
constexpr ulint INNODB_LOG_WRITE_MAX_SIZE_DEFAULT
Default value of innodb_log_write_max_size (in bytes).
Definition: log0constants.h:406
constexpr uint32_t LOG_BLOCK_HDR_SIZE
Size of the log block's header in bytes.
Definition: log0constants.h:290
constexpr ulong INNODB_LOG_WRITE_AHEAD_SIZE_MIN
Minimum allowed value of innodb_log_write_ahead_size.
Definition: log0constants.h:517
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:190
constexpr ulong INNODB_LOG_EVENTS_MAX
Maximum allowed value of innodb_log_events.
Definition: log0constants.h:511
constexpr uint32_t LOG_BLOCK_HDR_DATA_LEN
Offset to number of bytes written to this block (also header bytes).
Definition: log0constants.h:256
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:444
constexpr uint32_t LOG_BLOCK_DATA_SIZE
Size of log block's data fragment (where actual data is stored).
Definition: log0constants.h:305
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:331
constexpr uint32_t LOG_HEADER_FLAG_NO_LOGGING
Flag at BIT-1 to indicate if redo logging is disabled or not.
Definition: log0constants.h:213
constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_MIN
Minimum allowed value of innodb_log_recent_closed_size.
Definition: log0constants.h:499
constexpr uint32_t LOG_HEADER_LOG_UUID
Offset within the log file header, to the field which stores the log_uuid.
Definition: log0constants.h:182
constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_DEFAULT
Default value of innodb_log_recent_written_size (in bytes).
Definition: log0constants.h:487
constexpr os_offset_t LOG_HEADER_ENCRYPTION_INFO_OFFSET
Offset to encryption information in the log encryption header.
Definition: log0constants.h:200
constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_DEFAULT
Default value of innodb_log_recent_closed_size (in bytes).
Definition: log0constants.h:496
constexpr uint32_t MLOG_TEST_MAX_REC_LEN
Maximum size of single MLOG_TEST record (in bytes).
Definition: log0constants.h:537
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:359
constexpr uint32_t LOG_BLOCK_FIRST_REC_GROUP
Offset to "first_rec_group offset" stored in the log block header.
Definition: log0constants.h:273
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:222
constexpr os_offset_t LOG_CAPACITY_MAX
Maximum allowed value for innodb_redo_log_capacity.
Definition: log0constants.h:96
constexpr os_offset_t LOG_HEADER_CREATOR_END
End of the log file creator field (we add 1 for \0).
Definition: log0constants.h:196
constexpr os_offset_t LOG_FILE_MAX_SIZE
Maximum size of single log file, expressed in bytes.
Definition: log0constants.h:90
constexpr uint32_t LOG_BLOCK_HDR_NO
Offset to hdr_no, which is a log block number and must be > 0.
Definition: log0constants.h:246
constexpr lsn_t LSN_MAX
Maximum possible lsn value is slightly higher than the maximum sn value, because lsn sequence enumera...
Definition: log0constants.h:152
constexpr ulong INNODB_LOG_WRITE_AHEAD_SIZE_DEFAULT
Default value of innodb_log_write_ahead_size (in bytes).
Definition: log0constants.h:514
constexpr ulint INNODB_LOG_WRITE_AHEAD_SIZE_MAX
Maximum allowed value of innodb_log_write_ahead_size.
Definition: log0constants.h:520
constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_MIN
Minimum allowed value of innodb_log_recent_written_size.
Definition: log0constants.h:490
constexpr ulong INNODB_LOG_CHECKPOINT_EVERY_DEFAULT
Default value of innodb_log_checkpointer_every (in milliseconds).
Definition: log0constants.h:409
constexpr uint32_t LOG_BLOCK_EPOCH_NO
Offset to epoch_no stored in this log block.
Definition: log0constants.h:287
constexpr ulong INNODB_LOG_EVENTS_DEFAULT
Default value of innodb_log_events (number of events).
Definition: log0constants.h:505
constexpr os_offset_t LOG_FILE_HDR_SIZE
Size of log file's header.
Definition: log0constants.h:169
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:393
constexpr uint32_t LOG_NO_CHECKSUM_MAGIC
Magic value to use instead of log checksums when they are disabled.
Definition: log0constants.h:143
constexpr ulong INNODB_LOG_EVENTS_MIN
Minimum allowed value of innodb_log_events.
Definition: log0constants.h:508
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:449
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:226
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:260
constexpr os_offset_t LOG_CAPACITY_MIN
Minimum allowed value for innodb_redo_log_capacity.
Definition: log0constants.h:93
constexpr ulong INNODB_LOG_WRITE_NOTIFIER_TIMEOUT_DEFAULT
Default value of innodb_log_write_notifier_timeout (in microseconds).
Definition: log0constants.h:469
constexpr uint INNODB_LOG_SPIN_CPU_PCT_HWM_DEFAULT
Default value of innodb_log_spin_cpu_pct_hwm.
Definition: log0constants.h:429
constexpr ulong INNODB_LOG_FLUSH_NOTIFIER_SPIN_DELAY_DEFAULT
Default value of innodb_log_flush_notifier_spin_delay (in spin rounds).
Definition: log0constants.h:472
constexpr double LOG_EXTRA_CONC_MARGIN_PCT
Extra margin, reserved in the redo capacity for the concurrency margin.
Definition: log0constants.h:350
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:389
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:380
constexpr uint32_t LOG_BLOCK_TRL_SIZE
Size of the log block footer (trailer) in bytes.
Definition: log0constants.h:299
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:232
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:253
constexpr os_offset_t LOG_ENCRYPTION
Log Encryption information in redo log header.
Definition: log0constants.h:163
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:540
constexpr uint32_t LOG_HEADER_FLAG_CRASH_UNSAFE
Flag at BIT-2 to indicate if server is not recoverable on crash.
Definition: log0constants.h:218
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:452
constexpr size_t LOG_HEADER_CREATOR_MAX_LENGTH
Maximum length of string with creator name (excludes \0).
Definition: log0constants.h:193
constexpr os_offset_t LOG_HEADER_FLAGS
32 BITs flag
Definition: log0constants.h:210
constexpr ulong INNODB_LOG_WRITER_SPIN_DELAY_DEFAULT
Default value of innodb_log_writer_spin_delay (in spin rounds).
Definition: log0constants.h:417
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:534
constexpr ulong INNODB_LOG_WAIT_FOR_FLUSH_TIMEOUT_DEFAULT
Default value of innodb_log_wait_for_flush_timeout (in microseconds).
Definition: log0constants.h:455
constexpr double LOG_EXTRA_WRITER_MARGIN_PCT
Extra margin, reserved in the redo capacity for the log writer thread.
Definition: log0constants.h:345
constexpr os_offset_t LOG_EXTRA_SAFETY_MARGIN
Extra safety margin in the redo capacity, never ever used !
Definition: log0constants.h:326
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:367
constexpr ulong INNODB_LOG_WRITE_NOTIFIER_SPIN_DELAY_DEFAULT
Default value of innodb_log_write_notifier_spin_delay (in spin rounds).
Definition: log0constants.h:466
constexpr ulong INNODB_LOG_BUFFER_SIZE_MAX
Maximum allowed value of innodb_log_buffer_size.
Definition: log0constants.h:484
constexpr uint32_t LOG_BLOCK_CHECKSUM
4 byte checksum of the log block contents.
Definition: log0constants.h:296
constexpr os_offset_t LOG_HEADER_FORMAT
Log file header format identifier (32-bit unsigned big-endian integer).
Definition: log0constants.h:176
constexpr ulong INNODB_LOG_SPIN_CPU_ABS_LWM_DEFAULT
Default value of innodb_log_spin_cpu_abs_lwm.
Definition: log0constants.h:425
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:441
constexpr ulong INNODB_LOG_BUFFER_SIZE_DEFAULT
Default value of innodb_log_buffer_size (in bytes).
Definition: log0constants.h:478
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:100
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:185
constexpr size_t LOG_MAX_OPEN_FILES
Maximum number of handles for opened redo log files (in parallel).
Definition: log0constants.h:128
constexpr ulong INNODB_LOG_FLUSHER_TIMEOUT_DEFAULT
Default value of innodb_log_flusher_timeout (in microseconds).
Definition: log0constants.h:463
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:373
constexpr ulong INNODB_LOG_WRITER_TIMEOUT_DEFAULT
Default value of innodb_log_writer_timeout (in microseconds).
Definition: log0constants.h:421
constexpr os_offset_t LOG_CHECKPOINT_2
Second checkpoint field in the header of the first log file.
Definition: log0constants.h:166
constexpr ulong INNODB_LOG_FLUSHER_SPIN_DELAY_DEFAULT
Default value of innodb_log_flusher_spin_delay (in spin rounds).
Definition: log0constants.h:459
constexpr ulong INNODB_LOG_RECENT_WRITTEN_SIZE_MAX
Maximum allowed value of innodb_log_recent_written_size.
Definition: log0constants.h:493
constexpr ulong INNODB_LOG_RECENT_CLOSED_SIZE_MAX
Maximum allowed value of innodb_log_recent_closed_size.
Definition: log0constants.h:502
constexpr ulong INNODB_LOG_BUFFER_SIZE_MIN
Minimum allowed value of innodb_log_buffer_size.
Definition: log0constants.h:481
Redo log basic types.
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
unsigned int uint
Definition: uca-dump.cc:29
constexpr uint32_t UNIV_PAGE_SIZE_DEF
Default page size for InnoDB tablespaces.
Definition: univ.i:326
unsigned long int ulint
Definition: univ.i:407
constexpr size_t UNIV_PAGE_SIZE_MAX
Maximum page size InnoDB currently supports.
Definition: univ.i:324