[MDEV-25709] Replication IO_Thread Connecting Primary server handshake call "SELECT GTID_BINLOG_POS" even when MASTER_USE_GITD=NO and GTID is disabled Created: 2021-05-18 Updated: 2023-12-15 |
|
| Status: | In Review |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Pramod Mahto | Assignee: | Andrei Elkin |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Replication IO_Thread call SELECT GTID_BINLOG_POS even when MASTER_USE_GTID=NO and GTID is disabled.
This unnecessary query execution can hang IO thread for significant time, Causing slave lag (MDEV-25764) |
| Comments |
| Comment by Sachin Setiya (Inactive) [ 2021-05-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In slave.cc this reason is given for asking binlog_gtid_pos from master
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2021-06-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Elkin,
these lines , which will make gtid_slave_pos to not update on the slave start.
After slave restart
and with this patch these row addition will not happen
To me it does not seem like a big issue, But this does cause rpl_gtid_stop_start test to fail. 2. Loss of update in gtid_slave_pos table on slave.
I am not sure if 2 is a big issue or not , it depends what user expects from gtid_slave_pos table when MASTER_USE_GTID=NO. According to me if user is not using gtid they should not be concerned with gtid_slave_pos status. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2021-06-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Patch branch bb-10.2-25709 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2023-08-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just to make it clear, it is not a bug that non-GTID slave obtains the GTID position when connecting, it's a important feature of MariaDB GTID. For example, this is what enables to take a non-locking xtrabackup of InnoDB (which recovers the binlog-file/offset replication position in a transactional way), use that to provision a slave and connect it in non-GTID mode, and then immediately switch it to GTID mode. The real bug is that obtaining the GTID position has poor performance. The correct fix for that is MDEV-4991, GTID binlog indexing. Still, it's unfortunate that this performance problem has been around for so long. It can be valid to provide a way to avoid the performance overhead until the "real" solution of MDEV-4991. We should just keep in mind that this is a performance bug, not a "wrong behavior" bug, and plan so that the correct solution can be implemented without impacting upgrades and backwards compatibility. Also, it's good to mention the work-around that is currently available, which is to reduce the size of the binlog files (--max-binlog-size). |