GTID auto positioning replication doesn't work correctly on PXC node with new async monitor logic

Description

With auto-positioning it is possible to have scenarios where the transactions received in replication channel doesn’t have continuous sequence numbers since replication works by getting the gtids from the source which have not been executed on the target, which may exist even prior to already applied transaction (which would most probably doesn’t have sequence number as expected by newly introduced async monitor logic).

One such Scenario:

  1. Setup a source PS server and execute: set @@session.sql_log_bin=0; create database db1; create table db1.t(a int primary key);set @@session.sql_log_bin=1;

  2. Setup a replica server (without starting replication) and execute: set @@session.sql_log_bin=0; create database db1; create table db1.t(a int primary key);set @@session.sql_log_bin=1;

  3. Execute couple of inserts on source PS server.

  4. Configure replica to replicate transactions from source by skipping some inserts, by configuring the source_log_pos to some advanced position in source’s binary log (with source_auto_position=0). Say start replicating from third insert (So, GTIDs, <UUID:1-2> would not be replicated to replica).

  5. Start replication on replica server and verify that replication works successfully( But GTIDs, <UUID:1-2> would not have been replicated.)

  6. Stop replication on replica server and enable GTID auto positioning (source_auto_position=1). Start replication.

  7. Replication now would hang on the replica server as async monitor would be expecting some other sequence number. Replication will hang and further transactions if any will not be replicated.

Environment

None

Activity

Show:
Done

Assignee

Reporter

Needs QA

Sprint

Fix versions

Priority

Created September 30, 2024 at 5:37 AM
Updated April 16, 2025 at 5:34 PM
Resolved January 22, 2025 at 7:25 AM