0

I created an RDS instance on AWS (Aurora MySQL with replication). When I start importing an SQL file into the database I get an error message ERROR 2013 (HY000) at line 2805: Lost connection to MySQL server during query and AWS changes the replication role from writer to reader.

Is there a way to disable changing of the replication role during import or some other way to fix it?

Zvonimir Burić
  • 528
  • 3
  • 11
  • The error message in AWS console is `Read replica has fallen behind the master too much. Restarting Mysql.` – Zvonimir Burić Jan 24 '18 at 16:52
  • This sounds like your import is actually causing a crash. The changing replication role is a side effect, not the cause. Whatever is happening near line 2805 in your dump file seems to be the cause, and you might start by investigating that. Check also what version of Aurora you are running. `SELECT AURORA_VERSION();`. – Michael - sqlbot Jan 25 '18 at 00:46
  • Now it crashed at the line 2000. It's Aurora 1.16. – Zvonimir Burić Jan 25 '18 at 09:01
  • I also tried to use the cluster url instead of the instance url but the same happens. – Zvonimir Burić Jan 25 '18 at 09:02
  • What is at those lines? `INSERT` statements? What happens if you try this on an Aurora cluster with only one instance? – Michael - sqlbot Jan 25 '18 at 09:04
  • Yes, it's only insert statements. I created another cluster with only one instance and it worked. – Zvonimir Burić Jan 25 '18 at 10:18
  • Interesting. Here's why I suggested that: this sounds like it could point to a problem in Aurora. Scenario: loading the dump file causes the cluster to panic because the reader lags the writer excessively during your data load, so the cluster incorrectly concludes that a failure scenario is happening, promotes another reader to writer and reboots the current writer, which of course becomes a reader once it recovers. – Michael - sqlbot Jan 25 '18 at 13:02
  • If I choose MySql (not Aurora) on RDS it doesn't create a cluster and another instance like on Aurora, even if I choose replication. Why is that? What would you suggest? Using Aurora without replication or using MySql server? Or should I enable replication after importing the dump file? Thanks for your help – Zvonimir Burić Jan 25 '18 at 16:35

0 Answers0