Bug #116702 gtid_mode=on but autoposition is 0 MTS recovery perform unnecessary operations
Submitted: 19 Nov 2024 6:05 Modified: 19 Nov 2024 16:56
Reporter: karry zhang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:8.0.40 OS:Any
Assigned to: CPU Architecture:Any

[19 Nov 2024 6:05] karry zhang
Description:
When gtid_mode is on, replicated transactions must be GTID transactions. We don't need to fill the gap of sequence transacion, because when replay the Gtid_log_event, the transaction represented by gtid will be skipped.

But I see when auto_position is not set,  we still need to fill the gap. 

How to repeat:
The mts_recovery_groups function has the following code:

 if (global_gtid_mode.get() == Gtid_mode::ON && rli->mi &&
      rli->mi->is_auto_position()) {
    rli->mts_recovery_group_cnt = 0;
    return false;
  }

gtid_mode must be on and autoposition must be on to skip filling gaps.

Suggested fix:
When gtid_mode is on, we can skip filling gaps.
[19 Nov 2024 16:56] MySQL Verification Team
Hi,

Thanks for the suggestion, I'll log it as feature request