mariadb/storage/innobase/include
Kristian Nielsen 52a75d4532 Binlog-in-engine: Fix incorrect GTID position at slave connect
The GTID position at slave connect is found from the GTID state records
written at the start and at every --innodb-binlog-state-interval bytes of
the binlog files. There was a bug that for a binlog group commit, the binlog
state written was the one corresponding to the last GTID in the group,
regardless of where during the binlogging of the group it was written. Thus,
it could mistakenly write a GTID state record of 0-1-10, say, followed by a
lower GTID 0-1-9. This could cause a slave connecting at 0-1-10 to receive
an extra GTID 0-1-9, and replication would diverge.

Fix by maintaining a full GTID binlog state inside the engine binlog, same
as is done for the differential state.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-01-16 23:05:04 +01:00
..
btr0btr.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
btr0btr.inl MDEV-29603 btr_cur_open_at_index_side() is missing some consistency checks 2022-11-17 08:19:01 +02:00
btr0bulk.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
btr0cur.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
btr0cur.inl MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
btr0pcur.h Merge 10.5 into 10.6 2024-04-19 16:01:26 +03:00
btr0pcur.inl MDEV-30400 Assertion height == btr_page_get_level(...) on INSERT 2023-01-24 14:09:21 +02:00
btr0sea.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
btr0sea.inl MDEV-27700 ASAN: Heap_use_after_free in btr_search_drop_page_hash_index() 2022-08-22 16:29:46 +05:30
btr0types.h MDEV-34458 wait_for_read in buf_page_get_low hurts performance 2024-06-26 13:51:38 +03:00
buf0buddy.h MDEV-36781: Assertion i < BUF_BUDDY_SIZES failed in buf_buddy_shrink() 2025-05-13 12:27:46 +03:00
buf0buf.h MDEV-34705: Binlog-in-engine: Crash-safe slave 2026-01-16 14:57:12 +01:00
buf0buf.inl MDEV-29445: Reimplement SET GLOBAL innodb_buffer_pool_size 2025-03-26 17:05:44 +02:00
buf0checksum.h MDEV-25105 Remove innodb_checksum_algorithm values none,innodb,... 2021-03-11 12:46:18 +02:00
buf0dblwr.h Merge 10.11 into 11.4 2025-04-02 10:15:08 +03:00
buf0dump.h Make .clang-format work with clang-8 2019-11-15 18:09:30 +01:00
buf0flu.h Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
buf0lru.h Merge 10.11 into 11.4 2025-03-28 13:55:21 +02:00
buf0rea.h MDEV-37244: Avoid page lookup after read 2025-10-17 12:35:34 +03:00
buf0types.h Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
cache.h MDEV-33447 fixup for POWER 8 2024-04-24 12:39:30 +03:00
data0data.h Merge branch '10.6' into 10.11 2024-04-22 15:23:10 +02:00
data0data.inl Merge branch '10.4' into 10.5 2024-04-16 11:04:14 +02:00
data0type.h Merge branch '10.11' into 11.4 2025-11-04 13:44:16 +01:00
data0type.inl Merge branch '10.11' into 11.4 2025-11-04 13:44:16 +01:00
data0types.h Update FSF Address 2019-05-11 21:29:06 +03:00
db0err.h MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
dict0boot.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
dict0crea.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
dict0crea.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0dict.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
dict0dict.inl Merge 10.11 into 11.4 2025-03-03 11:07:56 +02:00
dict0load.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
dict0mem.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
dict0mem.inl Merge 10.5 into 10.6 2024-04-17 14:14:58 +03:00
dict0pagecompress.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0pagecompress.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0stats.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
dict0stats_bg.h Merge 10.5 into 10.6 2022-04-26 15:21:20 +03:00
dict0types.h MDEV-34953 followup - allow Innodb to work with old data dictionary without upgrade. 2025-10-07 21:46:28 +03:00
dyn0buf.h MDEV-36024 preparation: Shrink mtr_buf_t 2025-09-02 13:21:36 +03:00
dyn0types.h Merge from 10.4 to 10.5 2024-04-15 17:46:49 +02:00
eval0eval.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
eval0eval.inl MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
eval0proc.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
eval0proc.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fil0crypt.h Merge branch '10.6' into 10.11 2024-08-03 09:15:40 +02:00
fil0crypt.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fil0fil.h MDEV-34705: Binlog in Engine: Very first sketch, able to create and write an InnoDB tablespace 2026-01-16 14:48:53 +01:00
fil0pagecompress.h Merge 10.6 into 10.7 2021-08-19 13:03:48 +03:00
fsp0file.h Merge 10.11 into 11.2 2024-10-18 11:32:22 +03:00
fsp0fsp.h MDEV-34705: Binlog-in-engine: Refactor InnoDB part 2026-01-16 14:48:54 +01:00
fsp0space.h MDEV-26195: Use a 32-bit data type for some tablespace fields 2021-07-22 11:22:47 +03:00
fsp0sysspace.h MDEV-34529 Shrink the system tablespace when system tablespace contains MDEV-30671 leaked undo pages 2024-10-16 21:34:24 +05:30
fsp0types.h Binlog-in-engine: Fixes for some review comments 2026-01-16 14:57:13 +01:00
fsp_binlog.h Binlog-in-engine: Clean up few remaining todos, error handling 2026-01-16 23:05:04 +01:00
fts0ast.h Merge 10.4 to 10.5 2020-10-22 17:08:49 +03:00
fts0blex.h
fts0fts.h MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
fts0opt.h Merge 10.1 to 10.2 2019-10-25 17:33:39 +03:00
fts0pars.h
fts0plugin.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0priv.h Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
fts0priv.inl MDEV-33383: Corrupted red-black tree due to incorrect comparison 2024-02-12 17:01:45 +02:00
fts0tlex.h
fts0tokenize.h MDEV-21581 Helper functions and methods for CHARSET_INFO 2020-01-28 12:29:23 +04:00
fts0types.h Merge 10.5 into 10.6 2024-02-13 20:42:59 +02:00
fts0types.inl MDEV-33383: Corrupted red-black tree due to incorrect comparison 2024-02-12 17:01:45 +02:00
fts0vlc.h MDEV-19522 InnoDB commit fails when FTS_DOC_ID value is greater than 4294967295 2021-10-21 12:56:59 +03:00
fut0lst.h MDEV-35689 InnoDB system tables cannot be optimized or defragmented 2025-04-10 17:13:34 +05:30
gis0geo.h MDEV-27675 review fixup 2025-10-23 07:36:12 +03:00
gis0rtree.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
gis0rtree.inl MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
gis0type.h Merge 10.5 into 10.6 2024-04-17 14:14:58 +03:00
ha0ha.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha0ha.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha0storage.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ha0storage.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha_prototypes.h Merge 10.11 into 11.4 2025-11-28 12:56:27 +02:00
handler0alter.h Merge branch '10.2' into 10.3 2020-05-04 16:47:11 +02:00
hash0hash.h MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
ibuf0ibuf.h MDEV-29930 Lock order inversion in ibuf_remove_free_page() 2025-09-11 13:25:08 +03:00
innodb_binlog.h Binlog-in-engine: Fix incorrect GTID position at slave connect 2026-01-16 23:05:04 +01:00
lock0iter.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
lock0lock.h Merge branch '10.11 into 11.4 2025-01-30 12:01:11 +01:00
lock0lock.inl MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
lock0prdt.h MDEV-20612: Partition lock_sys.latch 2021-02-12 17:44:32 +02:00
lock0priv.h MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
lock0priv.inl Merge branch '10.11' into bb-11.4-release 2025-09-15 16:17:33 +02:00
lock0types.h MDEV-34877 Port "Bug #11745929 Change lock priority so that the transaction holding S-lock gets X-lock first" fix from MySQL to MariaDB 2025-01-23 17:38:32 +03:00
log0crypt.h Merge 10.11 into 11.4 2025-09-03 10:32:56 +03:00
log0log.h Binlog-in-engine: Fixes for some review comments 2026-01-16 14:57:13 +01:00
log0recv.h Binlog-in-innodb: Fix some review comments in InnoDB code 2026-01-16 23:05:04 +01:00
log0types.h Remove bogus references to replaced Google contributions 2023-08-21 15:51:16 +03:00
mach0data.h Always inline simple mach_read/write 2025-09-02 13:30:39 +03:00
mach0data.inl Always inline simple mach_read/write 2025-09-02 13:30:39 +03:00
mem0mem.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
mem0mem.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
mtr0log.h Binlog-in-engine: Fixes for some review comments 2026-01-16 14:57:13 +01:00
mtr0mtr.h Binlog-in-engine: Fixes for some review comments 2026-01-16 14:57:13 +01:00
mtr0types.h Merge 10.6 into 10.8 2023-02-16 09:17:06 +02:00
os0file.h Merge 10.11 into 11.4 2025-09-03 10:32:56 +03:00
os0file.inl Merge branch '10.6' into 10.11 2024-10-29 15:24:38 +01:00
page0cur.h Merge 10.11 into 11.2 2024-08-29 16:02:57 +03:00
page0cur.inl Merge 10.11 into 11.2 2024-08-29 16:02:57 +03:00
page0page.h Merge 10.11 into 11.4 2024-12-02 11:35:34 +02:00
page0page.inl MDEV-32175: Reduce page_align(), page_offset() calls 2024-11-21 11:01:30 +02:00
page0types.h MDEV-27924 page_zip_copy_recs() corrupts ROW_FORMAT=COMPRESSED block descriptor 2022-02-23 11:34:52 +02:00
page0zip.h MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
page0zip.inl MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
pars0grm.h Cleanup: Remove pars_stored_procedure_call() 2021-07-29 15:37:35 +03:00
pars0opt.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
pars0pars.h MDEV-25919 preparation: Various cleanup 2021-08-31 13:54:20 +03:00
pars0sym.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
pars0types.h Update FSF Address 2019-05-11 21:29:06 +03:00
que0que.h MDEV-34515: Reduce context switching in purge 2024-08-26 12:23:17 +03:00
que0que.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
que0types.h MDEV-23379 Deprecate&ignore InnoDB concurrency throttling parameters 2020-08-04 06:59:29 +03:00
read0types.h MDEV-24402: InnoDB CHECK TABLE ... EXTENDED 2022-10-21 10:02:54 +03:00
rem0cmp.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
rem0rec.h Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
rem0rec.inl MDEV-29694 Remove the InnoDB change buffer 2023-01-11 17:59:36 +02:00
rem0types.h Merge 10.4 into 10.5 2020-05-05 21:16:22 +03:00
row0ext.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
row0ext.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
row0ftsort.h Merge branch '10.5' into 10.6 2023-11-08 15:57:05 +01:00
row0import.h MDEV-26137 Improve import tablespace workflow. 2023-07-04 17:56:27 +10:00
row0ins.h Merge 10.5 into 10.6 2023-03-28 15:25:52 +03:00
row0log.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
row0merge.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
row0mysql.h MDEV-35854: Clarify row_rename_table_for_mysql() 2025-01-23 14:38:35 +02:00
row0purge.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
row0quiesce.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
row0row.h Merge 10.11 into 11.4 2025-03-03 11:07:56 +02:00
row0row.inl MDEV-36015: unrepresentable value in row_parse_int() 2025-02-13 15:10:53 +01:00
row0sel.h MDEV-36015: unrepresentable value in row_parse_int() 2025-02-13 15:10:53 +01:00
row0types.h Merge 10.4 into 10.5 2020-03-30 19:07:25 +03:00
row0uins.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
row0umod.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
row0undo.h MDEV-32050: Clean up log parsing 2023-10-25 08:27:08 +03:00
row0upd.h Merge 10.5 into 10.6 2023-01-03 18:13:11 +02:00
row0upd.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
row0vers.h MDEV-37152: Remove many calls to _current_thd() 2025-09-29 14:35:02 +03:00
rw_lock.h MDEV-34983: Remove x86 asm from InnoDB 2024-09-23 12:51:27 +03:00
small_vector.h Binlog-in-engine: Fixes for some review comments 2026-01-16 14:57:13 +01:00
srv0mon.h Merge 10.11 into 11.4 2025-09-03 10:32:56 +03:00
srv0mon.inl MDEV-36993: Format log for srv_mon_reset_all 2025-09-02 15:31:34 +05:30
srv0srv.h MDEV-37152: Reimplement innodb_buffer_pool_read_requests 2025-09-29 14:13:27 +03:00
srv0start.h MDEV-19229 Allow innodb_undo_tablespaces to be changed after database creation 2022-10-25 11:19:36 +05:30
srw_lock.h MDEV-37244: Avoid spin loop on page I/O waits 2025-10-17 09:41:50 +03:00
sux_lock.h MDEV-37244: Avoid spin loop on page I/O waits 2025-10-17 09:41:50 +03:00
transactional_lock_guard.h MDEV-34973 fixup for POWER,s390x 2024-10-01 13:29:59 +03:00
trx0i_s.h MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
trx0purge.h Merge 10.11 into 11.4 2025-10-17 09:05:29 +03:00
trx0rec.h Merge 10.6 into 10.11 2024-08-29 07:47:29 +03:00
trx0roll.h MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
trx0rseg.h Merge 10.6 into 10.11 2024-10-03 10:55:08 +03:00
trx0sys.h MDEV-37138: Innochecksum fails to handle doublewrite buffer and 2025-11-11 13:43:43 +05:30
trx0trx.h Binlog-in-engine: Clean up few remaining todos, error handling 2026-01-16 23:05:04 +01:00
trx0trx.inl MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
trx0types.h MDEV-36504 Memory leak after CREATE TABLE..SELECT 2025-04-17 12:04:09 +05:30
trx0undo.h MDEV-37138: Innochecksum fails to handle doublewrite buffer and 2025-11-11 13:43:43 +05:30
trx0undo.inl MDEV-33819 The purge of committed history is mis-parsing some log 2024-04-08 11:48:46 +03:00
trx0xa.h Update FSF Address 2019-05-11 21:29:06 +03:00
univ.i Binlog-in-engine: Initial support for 2pc and XA 2026-01-16 23:05:04 +01:00
ut0byte.h MDEV-21174 fixup: Remove unused ut_bit_set_nth() 2023-09-19 18:02:56 +03:00
ut0byte.inl MDEV-21174 fixup: Remove unused ut_bit_set_nth() 2023-09-19 18:02:56 +03:00
ut0counter.h Merge 10.5 into 10.6 2024-06-17 08:40:07 +03:00
ut0dbg.h Merge 10.2 into 10.3 2019-05-29 11:32:46 +03:00
ut0list.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0list.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0lst.h Do not use C++11 before MariaDB 10.4 2022-10-14 11:54:05 +03:00
ut0mem.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0mem.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0new.h MDEV-34705: Binlog-in-engine: Drop old X/X0Y.cc name convention for new files 2026-01-16 14:48:54 +01:00
ut0pool.h Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
ut0rbt.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
ut0rnd.h MDEV-35247: ut_hash_ulint() is a waste 2024-11-21 08:59:31 +02:00
ut0rnd.inl MDEV-35247: ut_hash_ulint() is a waste 2024-11-21 08:59:31 +02:00
ut0sort.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
ut0stage.h MDEV-21907: Fix most clang -Wconversion in InnoDB 2020-03-11 08:29:48 +02:00
ut0ut.h Merge 10.6 into 10.11 2024-02-08 15:04:46 +02:00
ut0ut.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0vec.h MDEV-33383: Replace fts_doc_id_cmp, ib_vector_sort 2024-02-12 17:01:17 +02:00
ut0vec.inl MDEV-33383: Replace fts_doc_id_cmp, ib_vector_sort 2024-02-12 17:01:17 +02:00
ut0wqueue.h Merge 10.5 into 10.6 2021-10-21 16:06:34 +03:00