0
votes

I'm trying to create an MySQL 5.7.35 read-only replica on GCP from an external origin. The database is enourmous, with aproximately 800G of data. I have already ajusted the definer on the triggers, views and functions in a way that GCP accepts (root@%) and thefore the full-dump that the Database Migration Service makes worked. Also got the replication working with the schema of this database (no data).

So far made just one attempt with data. On this attempt the full-dump was sucesful (took 2 days and 10 hours) and failed some time after the replication started with the following error:

2021-09-05T06:09:33.293123Z 2 [ERROR] Slave SQL for channel '': Could not execute Write_rows event on table pacsdb.content_item; Duplicate entry '1441957' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log medvia-mysql-bin.000005, end_log_pos 78621021, Error_code: 1062

Selecting this row on the replica returned the same data of the origin (the row was already there).

Since I can't stop slave, skip_counter and start slave or something like that on GCP I have to figure out why this is happening.

My next step would be try to make the dump manualy using the flags that Google recommends.

Someone had a similar problem or have a clue why this is happening?

Any tips are apreciated, thx!