Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-9238: Make MySQL 5.7 compatible with
CREATE TABLE AS SELECT [...] START TRANSACTION to improve 8.0 -> 5.7 replication reliability https://perconadev.atlassian.net/browse/PS-9238 Part 2.1 of the fix. When ctas_compatibility_mode=OFF the binlog sequence is: BEGIN CREATE TABLE ... START TRANSACTION ROW EVENT COMMIT MTS sees the above as one group. When the source produces binlog with CREATE TABLE ... START TRANSACTION but the intermediate replica is configured with ctas_compatibility_mode=ON it has to execute and binlog CTAS in legacy mode (pre 8.0.20). It means the intermediate commit will be done after CREATE TABLE. This commit will call pre_commit hook, which will call Slave_worker::commit_positions() where we check the validity of ptr_group->checkpoint_seqno. checkpoint_seqno however is set when group end is detected (COMMIT event), but it is too late. We detect CTAS case and set checkpoint_seqno to be prepared for intermediate commit.
- Loading branch information