Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.37, 10.2.21, 10.3.12
Description
Currently, gtid_binlog_pos can be manually updated by changing gtid_binlog_state.
https://mariadb.com/kb/en/library/gtid/#gtid_binlog_state
Since gtid_current_pos is a union of gtid_binlog_pos and gtid_slave_pos, this also updates gtid_current_pos. For example:
MariaDB [db1]> SHOW GLOBAL VARIABLES WHERE Variable_name IN( 'log_bin', 'server_id', 'gtid_binlog_pos', 'gtid_binlog_state', 'gtid_slave_pos', 'gtid_current_pos' );
|
+-------------------+------------------+
|
| Variable_name | Value |
|
+-------------------+------------------+
|
| gtid_binlog_pos | 1-1-101,2-1-2002 |
|
| gtid_binlog_state | 1-1-101,2-1-2002 |
|
| gtid_current_pos | 1-1-101,2-1-2002 |
|
| gtid_slave_pos | |
|
| log_bin | ON |
|
| server_id | 1 |
|
+-------------------+------------------+
|
6 rows in set (0.001 sec)
|
|
MariaDB [db1]> RESET MASTER;
|
Query OK, 0 rows affected (0.005 sec)
|
|
MariaDB [db1]> SHOW GLOBAL VARIABLES WHERE Variable_name IN( 'log_bin', 'server_id', 'gtid_binlog_pos', 'gtid_binlog_state', 'gtid_slave_pos', 'gtid_current_pos' );
|
+-------------------+-------+
|
| Variable_name | Value |
|
+-------------------+-------+
|
| gtid_binlog_pos | |
|
| gtid_binlog_state | |
|
| gtid_current_pos | |
|
| gtid_slave_pos | |
|
| log_bin | ON |
|
| server_id | 1 |
|
+-------------------+-------+
|
6 rows in set (0.001 sec)
|
|
MariaDB [db1]> SET GLOBAL gtid_binlog_state='1-1-101,2-1-2002';
|
Query OK, 0 rows affected (0.005 sec)
|
|
MariaDB [db1]> SHOW GLOBAL VARIABLES WHERE Variable_name IN( 'log_bin', 'server_id', 'gtid_binlog_pos', 'gtid_binlog_state', 'gtid_slave_pos', 'gtid_current_pos' );
|
+-------------------+------------------+
|
| Variable_name | Value |
|
+-------------------+------------------+
|
| gtid_binlog_pos | 1-1-101,2-1-2002 |
|
| gtid_binlog_state | 1-1-101,2-1-2002 |
|
| gtid_current_pos | 1-1-101,2-1-2002 |
|
| gtid_slave_pos | |
|
| log_bin | ON |
|
| server_id | 1 |
|
+-------------------+------------------+
|
6 rows in set (0.001 sec)
|
However, there seems to be a bug where gtid_current_pos is not updated if gtid_binlog_state is updated with GTIDs that contain non-local server_id values. Compare the above behavior to the following:
MariaDB [db1]> SHOW GLOBAL VARIABLES WHERE Variable_name IN( 'log_bin', 'server_id', 'gtid_binlog_pos', 'gtid_binlog_state', 'gtid_slave_pos', 'gtid_current_pos' );
|
+-------------------+------------------+
|
| Variable_name | Value |
|
+-------------------+------------------+
|
| gtid_binlog_pos | 1-1-101,2-1-2002 |
|
| gtid_binlog_state | 1-1-101,2-1-2002 |
|
| gtid_current_pos | 1-1-101,2-1-2002 |
|
| gtid_slave_pos | |
|
| log_bin | ON |
|
| server_id | 1 |
|
+-------------------+------------------+
|
6 rows in set (0.001 sec)
|
|
MariaDB [db1]> RESET MASTER;
|
Query OK, 0 rows affected (0.005 sec)
|
|
MariaDB [db1]> SHOW GLOBAL VARIABLES WHERE Variable_name IN( 'log_bin', 'server_id', 'gtid_binlog_pos', 'gtid_binlog_state', 'gtid_slave_pos', 'gtid_current_pos' );
|
+-------------------+-------+
|
| Variable_name | Value |
|
+-------------------+-------+
|
| gtid_binlog_pos | |
|
| gtid_binlog_state | |
|
| gtid_current_pos | |
|
| gtid_slave_pos | |
|
| log_bin | ON |
|
| server_id | 1 |
|
+-------------------+-------+
|
6 rows in set (0.001 sec)
|
|
MariaDB [db1]> SET GLOBAL gtid_binlog_state='1-2-101,2-2-2002';
|
Query OK, 0 rows affected (0.005 sec)
|
|
MariaDB [db1]> SHOW GLOBAL VARIABLES WHERE Variable_name IN( 'log_bin', 'server_id', 'gtid_binlog_pos', 'gtid_binlog_state', 'gtid_slave_pos', 'gtid_current_pos' );
|
+-------------------+------------------+
|
| Variable_name | Value |
|
+-------------------+------------------+
|
| gtid_binlog_pos | 1-2-101,2-2-2002 |
|
| gtid_binlog_state | 1-2-101,2-2-2002 |
|
| gtid_current_pos | |
|
| gtid_slave_pos | |
|
| log_bin | ON |
|
| server_id | 1 |
|
+-------------------+------------------+
|
6 rows in set (0.001 sec)
|
I think that if an update to gtid_binlog_state causes gtid_binlog_pos to be updated, then gtid_current_pos should also be updated--even if the GTIDs didn't contain the local server_id.
Attachments
Issue Links
- relates to
-
MDEV-18405 Add Mariabackup option to set gtid_slave_pos to original server's gtid_current_pos during prepare
- Stalled