RDS for MySQL Multi Master replication error 1236 from master when reading data from binary log

0

Hi,

Thank's for your tutorial.

I working under configuring multi master GTID based replication between Non-RDS and RDS MySQL instances. The idea is configure Non-RDS Master as replica for RDS MySQL Master, and vice versa

Non-RDS MySQL version - 5.7.29
RDS MySQL version - 5.7.37

Non-RDS Master is my local MySQL instance with ID - 5ea52da6-e25c-11ec-ac07-0aa67b862ee7
RDS Master is AWS RDS for MySQL instance with ID - a82ebef1-e265-11ec-964b-0af5faa008d7

I added to Non-DRS cnf and RDS database parameter group below values:

sync_binlog = 0
gtid-mode=ON
enforce-gtid-consistency
log-slave-updates
expire_logs_days = 10

on RDS I used call mysql.rds_set_configuration('binlog retention hours',168) to set binlog retention period

Replication from Non-RDS Master to RDS Master is operating normally.

But, after starting replication from RDS Master to Non-RDS Master, I receive an error 1236 on Non-RDS instance -

Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the replica requires

------------- This is my Non-RDS Master -------------

mysql> show global variables like 'gtid_executed'\G
*************************** 1. row ***************************
Variable_name: gtid_executed
Value: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-6
1 row in set (0.01 sec)

mysql>
mysql>
mysql> show global variables like 'gtid_purged'\G
*************************** 1. row ***************************
Variable_name: gtid_purged
Value: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-4
1 row in set (0.00 sec)

mysql>
mysql>
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000004
Position: 194
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-6
1 row in set (0.00 sec)

mysql> show replica status\G
*************************** 1. row ***************************
Master_Host: 172.31.45.85
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File:
Read_Master_Log_Pos: 4
Relay_Log_File: relay.000001
Relay_Log_Pos: 4
Relay_Master_Log_File:
Slave_IO_Running: No
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB: mysql,information_schema,performance_schema
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: noreplicate.%,mysql.rds_%
....
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID set sent by the slave is '5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-5', and the missing transactions are 'a82ebef1-e265-11ec-964b-0af5faa008d7:1-44'.'
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 219284118
Master_UUID: a82ebef1-e265-11ec-964b-0af5faa008d7
Master_Info_File: /var/lib/mysql/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
...
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp: 220602 12:37:06
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-5
Auto_Position: 1
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)

------------- This is my RDS Master -------------

mysql> show global variables like 'gtid_executed'\G
*************************** 1. row ***************************
Variable_name: gtid_executed
Value: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-6, a82ebef1-e265-11ec-964b-0af5faa008d7:1-52
1 row in set (0.00 sec)

mysql>
mysql> show global variables like 'gtid_purged'\G
*************************** 1. row ***************************
Variable_name: gtid_purged
Value: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-6, a82ebef1-e265-11ec-964b-0af5faa008d7:1-50
1 row in set (0.00 sec)

mysql>
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin-changelog.000025
Position: 234
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-6, a82ebef1-e265-11ec-964b-0af5faa008d7:1-52
1 row in set (0.00 sec)
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 172.31.32.33
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 194
Relay_Log_File: relaylog.000009
Relay_Log_Pos: 313
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB: information_schema,performance_schema
Replicate_Do_Table:
Replicate_Ignore_Table: mysql.plugin,mysql.rds_monitor,mysql.rds_sysinfo,innodb_memcache.cache_policies,mysql.rds_history,innodb_memcache.config_options,mysql.rds_configuration,mysql.rds_replication_status
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: noreplicate.%
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 194
Relay_Log_Space: 672
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:5-6
Executed_Gtid_Set: 5ea52da6-e25c-11ec-ac07-0aa67b862ee7:1-6, a82ebef1-e265-11ec-964b-0af5faa008d7:1-52
Auto_Position: 1
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)

Did I miss something?

rk
gefragt vor 2 Jahren857 Aufrufe
1 Antwort
0

Hi,

I am wondering whether the mysql.rds_skip_transaction_with_gtid will work with your situation. You can test this out to see if it is helpful or not.

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/mysql_rds_skip_transaction_with_gtid.html

AWS
SUPPORT-TECHNIKER
Kevin_Z
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen