Last_SQL_Error: Could not execute Delete_rows event on table Replication error?

Viewed 2226

I am in the process of migrating an on prem mysql database to amazon aurora and used the official AWS documentation. Per the Docs these are the steps that i have followed so far:-

  1. Set up Percona Xtrabackup.
  2. Took a backup and moved the data to S3.
  3. Went to RDS Dashboard and restored the database from S3.
  4. The Database is up and running successfully.

Now i am in the process of setting up binlog replication where my Aurora instance will be the replica while my on prem mysql is the master. To set up replication, i followed the steps as laid down in the official docs:-

  1. On my master, created a user 'replica-aurora' and provided the necessary permissions using GRANT REPLICATION SLAVE ON *.* TO 'replica-aurora'@'%' IDENTIFIED BY 'my-secret-password';

  2. Ran Show master status on my master which in on prem.

     File: mysql-bin.004762
      Position: 68093017
      Binlog_Do_DB: 
      Binlog_Ignore_DB: 
      Executed_Gtid_Set: 
      1 row in set (0.00 sec)
    
  3. Connected to my aurora instance and ran the following command :-

    CALL mysql.rds_set_external_master ('Ip-of-master', 3306, 'replica-aurora',  'password', 'mysql-bin.004762', 68093017, 0);
    
  4. Ran CALL mysql.rds_start_replication;

  5. When i check the show slave Status\G. I keep running into the following error message :-

    Slave_IO_State: Waiting for master to send event
                  Master_Host: Master-IP
                  Master_User: replica-aurora
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.004762
          Read_Master_Log_Pos: 71341857
               Relay_Log_File: relaylog.000002
                Relay_Log_Pos: 195715
        Relay_Master_Log_File: mysql-bin.004762
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: mysql.rds_replication_status,mysql.rds_monitor,mysql.rds_sysinfo,mysql.rds_configuration,mysql.rds_history
      Replicate_Wild_Do_Table: 
      Replicate_Wild_Ignore_Table: 
                   Last_Errno: 1032
                   Last_Error: Could not execute Delete_rows event on table db.feed; Can't find record in 'feed', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.004762, end_log_pos 68293560
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 68288412
              Relay_Log_Space: 3249360
              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: NULL
        Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 1032
               Last_SQL_Error: Could not execute Delete_rows event on table db.feed; Can't find record in 'feed', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.004762, end_log_pos 68293560
    

I tried setting sql_slave_skip_counter=1 and ran into this :-

mysql> SET GLOBAL sql_slave_skip_counter = 1; ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation

I tried skipping the current position using CALL mysql.rds_skip_repl_error; but ran into the following :-

mysql> CALL mysql.rds_skip_repl_error;
+-------------------------------------+
| Message                             |
+-------------------------------------+
| Statement in error has been skipped |
+-------------------------------------+
1 row in set (0.04 sec)

+-----------------------------------------------------------------------------------+
| Message                                                                           |
+-----------------------------------------------------------------------------------+
| Slave has encountered a new error. Please use SHOW SLAVE STATUS to see the error. |
+-----------------------------------------------------------------------------------+
1 row in set (2.14 sec)

Query OK, 0 rows affected (2.14 sec)

which is essentially the same error message as posted above. ERROR 1032.

Any one has ideas on how to fix this problem? I sure would appreciate that.

0 Answers
Related