[MDEV-17156] Local transactions on a Slave don't update GTID's gtid_current_pos after RESET MASTER on Slave (master_use_gtid value is not relevant) Created: 2018-09-07 Updated: 2020-08-25 Resolved: 2018-10-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.1.33 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Claudio Nanni | Assignee: | Andrei Elkin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
Server A = Master id=10133 {{MASTER_USE_GTID = slave_pos|current_pos }} (not relevant) Writing transactions on both A and B properly updates the global variable gtid_current_pos on the Slave (B). If I issue RESET MASTER on the Slave gtid_current_pos on the Slave stops being updated. I am aware of Kristian's comment on https://jira.mariadb.org/browse/MDEV-10279 but I still am not convinced.
Look what happens when the sequence number of the local transaction becomes higher than the sequence number of the latest transaction applied as Slave (gtid_slave_pos): Generate ~20 transactions on the Slave
_Generate other ~20 transactions on the Slave _
And one more...
Note gtid_current_pos changing value now from 0-10133-40 to 0-20133-41 To be said that clearing gtid_slave_pos "solves" that but of course it has its consequences. From what I see due to the fact that the locally generated transaction has a lower sequence number it's basically ignored until the sequence number surpasses the one contained in gtid_slave_pos I don't know if this is an intended behaviour. Manual page says: https://mariadb.com/kb/en/library/gtid/#gtid_current_pos
If you read paragraph [2] explains exactly the behaviour, and so it seems documented (even if not clear to me the rationale): but paragraph [3] says: Which is not true, gtid_current_pos does not contain the most recent GTID executed on the server, at least not until the sequence number is greater than the one in gtid_slave_pos. I don't know if it's just the documentation to be updated or there is something else. |
| Comments |
| Comment by Andrei Elkin [ 2018-09-17 ] |
|
claudio.nanni, hello. To 'the most recent' is defined in terms of the gtid sequence number. As the master and slave share the domain (0) the most recent Andrei PS. to |
| Comment by Claudio Nanni [ 2018-09-18 ] |
I still think it's wrong. Read again: That variable must be updated by definition, and it makes no sense that it isn't, what's the logic? Wouldn't it be simpler and more logical to just always update gtid_current_pos with local transactions? |
| Comment by Andrei Elkin [ 2018-09-21 ] |
|
gtid_current_pos is updated this way for the reason that it holds 'the most recent' value in the logical time sense. To gtid_current_pos specifically KN admitted that Change-Master's MASTER_USE_GTID = current_pos confused many people. |
| Comment by Claudio Nanni [ 2018-10-23 ] |
|
Andrei, > Oth to understand gtid_slave_pos must be comparatively easy. Yes, gtid_slave_pos would be an easier choice indeed but MaxScale uses gtid_current_pos for it's failover mechanism, maybe there is a valid reason for them to use gtid_slave_pos. |
| Comment by Andrei Elkin [ 2018-10-31 ] |
|
claudio.nanni, salute. I suggest we sum up what the docs say and how that matches our observations. 1. This report's synopsis states gtid_current_pos is not updated until a GTID arrived with gtid_seq_no > max(d), where d is a gtid domain present in gtid_current_pos. Such behavior matches the docs when 'recent' is understood in the logical time sense. 2. Notice that gtid_binlog_state may show changes but only for a reason 3. There is unreported observation that despite gtid_strict_mode = ON All in all I don't see there is anything that sticks out as questionable though Regardless of our dissatisfaction to this part the current issue is gtid_current_pos - should be stressed on that it's per domain array Feel free to revert the issue status, should you have more feedback. Cheers, Andrei |
| Comment by Andrei Elkin [ 2018-10-31 ] |
|
Reported traces of execution match definitions of the slave GTID state descriptors, as |