1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
mariadb/sql
ParadoxV5 89bd6b0033 MDEV-37530 Refactor Master & Relay Log info to iterable tuples
The persistence code of CHANGE MASTER values needs to match file
lines with the formatting for the corresponding field’s type.
This is unstructured, repetitive (not DRY), and makes feature expansions
(such as MDEV-28302 `CHANGE MASTER …=DEFAULT`)
error-prone if not difficult.

This commit moves these functions and global constants from
`slave.cc`/`.h`, as well as the Master and Relay Log Info File
entries from `Rpl_mi` and `Rpl_rli`, to dedicated `rpl_*info_file.h`
files and under corresponding structs to facilitate organization.
Namely, this commit wraps those file entries with transparent
structs that inherit from a `Persistent` interface,
or shared helper structs that themselves inherit from `Persistent`.
By moving the file read/write helper functions to or behind
implementations of `Persistent`’s virtual methods,
reading or writing the file only takes a type-agnostic loop
over the (wrapped) CHANGE MASTER values.

* This commit also includes preemptive support
  for preserving MDEV-28302’s `=DEFAULT`.
  As such, unset fields (namely `master_connect_retry`)
  now remember their `DEFAULT` states
  rather than whatever the default is at CHANGE MASTER time.
* For consistency’s sake, `master_heartbeat_period` is
  now reset at RESET REPLICA instead of CHANGE MASTER.

As this refactor will disconnect it from fixes for
some open bugs in prior versions, this commit also:
* Reimplements the value reader functions to be strict with their input
  * Fixes MDEV-38010
    number parsing ignores trailing garbage and overflows
  * Supercedes MDEV-38020 integer overflow
* Changes master_heartbeat_period from a `float` of seconds
  to a `uint32_t` of milliseconds (adding `/1000.0`s as needed)
  * Fixes MDEV-35879 `Slave_heartbeat_period` is imprecise
  * The maximum of `master_heartbeat_period` has been
    increased to 4294967.295, i.e., (2³²-1)÷1000.
  * `master_heartbeat_period` now rounds
    instead of truncates (rounds down).
* Prepares to make `master_retry_count` 64-bit on
  LLP64 (e.g., Windows) to match LP64 (e.g., Linux)

Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
2026-02-07 22:06:40 +01:00
..
2025-03-14 12:08:56 +04:00
2025-10-25 00:19:11 +07:00
…
2026-02-06 17:46:50 +01:00
2024-08-12 09:32:30 +01:00
2025-07-28 21:29:29 +02:00
2024-11-05 14:00:48 -08:00
2025-09-29 18:25:09 +03:00
2024-01-19 09:07:48 +02:00
2025-03-14 12:08:56 +04:00
2025-03-14 12:08:56 +04:00
…
2024-12-02 11:35:34 +02:00
2026-02-06 17:46:51 +01:00
2024-12-02 17:51:17 +02:00
2024-12-02 17:51:17 +02:00
2025-09-29 18:25:09 +03:00
2024-10-30 15:11:17 +01:00
…
2025-02-06 16:46:36 +01:00
2024-12-02 11:35:34 +02:00
2023-12-21 02:14:59 +01:00
…
2024-01-27 12:09:54 +01:00
2024-01-27 12:09:54 +01:00
2024-11-08 07:17:00 +01:00
2024-11-29 13:43:17 +02:00
…
…
2024-12-05 10:11:58 +01:00
2026-02-06 17:46:51 +01:00
2026-02-06 17:46:50 +01:00
2025-10-09 09:32:33 +02:00
2025-10-09 09:32:33 +02:00
2024-11-10 19:22:21 +01:00
2025-05-22 09:22:55 +02:00
2025-09-30 12:06:31 +03:00
2026-01-08 12:02:45 +01:00
2024-07-08 22:40:16 +02:00
2026-02-06 17:46:50 +01:00
…
…
2025-03-14 12:08:56 +04:00
2025-10-08 09:05:38 +02:00
…
2024-10-03 15:59:20 +10:00
…
2025-03-14 12:08:56 +04:00
2024-11-29 12:37:46 +02:00
2024-05-30 16:04:00 +03:00
2025-04-29 11:18:00 +10:00
2025-04-02 14:07:01 +03:00
2026-02-06 17:46:51 +01:00
2026-01-08 12:02:45 +01:00
2026-01-08 21:41:40 +01:00
2025-05-22 09:22:55 +02:00
2025-07-31 20:55:47 +02:00
2024-06-24 13:09:47 +03:00
2024-12-02 17:51:17 +02:00
2025-09-29 18:25:09 +03:00
2024-07-22 15:14:50 +02:00
2025-07-31 20:55:47 +02:00
2025-03-14 12:08:56 +04:00
2026-02-06 17:46:50 +01:00
2025-11-04 12:39:27 +01:00
2026-02-06 17:46:51 +01:00
2026-02-06 17:46:51 +01:00
2025-08-03 15:01:09 +02:00
2026-02-06 17:46:51 +01:00
2026-01-08 12:02:45 +01:00
2025-09-04 18:08:39 +03:00
2026-02-06 17:46:51 +01:00
2025-05-03 12:06:36 +02:00
2025-07-31 20:55:47 +02:00
2024-06-24 13:09:47 +03:00
2024-12-02 17:51:17 +02:00
2024-12-02 17:51:17 +02:00
2026-01-08 21:41:40 +01:00
2026-02-06 17:46:51 +01:00
2025-05-22 09:22:55 +02:00
2026-01-05 20:34:44 +01:00
2026-01-05 20:34:44 +01:00
2026-01-08 21:41:40 +01:00
2026-01-08 12:02:45 +01:00
2025-07-28 21:29:29 +02:00
2025-07-28 21:29:29 +02:00
2026-02-06 17:46:51 +01:00
2026-02-06 17:46:51 +01:00
…
2026-02-06 17:46:51 +01:00
2026-02-06 17:46:51 +01:00
2025-09-29 18:25:09 +03:00
2024-06-27 10:26:09 +03:00
2025-08-04 12:05:53 +02:00
2024-12-02 17:51:17 +02:00
2025-09-19 12:31:14 +03:00
2025-04-29 11:18:00 +10:00
2025-03-14 12:08:56 +04:00
2026-02-06 17:46:51 +01:00
2025-07-28 21:29:29 +02:00
2024-07-03 12:45:30 +02:00
2025-01-09 09:41:38 +02:00
2026-02-06 17:46:51 +01:00
2023-12-17 11:20:43 +01:00
2024-12-02 17:51:17 +02:00
2025-09-29 18:25:09 +03:00
2025-07-31 20:55:47 +02:00
2025-07-31 20:55:47 +02:00
2026-02-06 17:46:50 +01:00
2025-04-29 11:18:00 +10:00
…
2026-01-05 20:34:44 +01:00
2026-01-08 12:02:45 +01:00
2025-03-14 12:08:56 +04:00
2024-12-02 17:51:17 +02:00
…
2026-01-05 20:34:44 +01:00
2026-02-06 17:46:51 +01:00
2025-06-18 07:50:39 +02:00
2024-01-10 18:01:46 +11:00
2025-04-29 11:18:00 +10:00
2025-09-04 18:08:39 +03:00
2024-06-24 13:09:47 +03:00
2025-03-14 12:08:56 +04:00
2024-12-02 17:51:17 +02:00
2024-12-02 11:35:34 +02:00
2025-03-14 12:08:56 +04:00
2026-01-08 12:02:45 +01:00
2025-11-28 12:56:27 +02:00
2024-06-27 10:26:09 +03:00
2024-05-10 20:02:18 +02:00
2026-01-08 12:02:45 +01:00
2026-01-08 12:02:45 +01:00
2024-10-03 13:24:43 +03:00
2024-09-09 13:50:38 +03:00
2025-04-18 17:11:01 +02:00
2024-11-08 07:17:00 +01:00
2026-01-08 12:02:45 +01:00
2025-11-11 10:34:33 +02:00
2025-07-31 20:55:47 +02:00