Hello
We use AWS RDS Aurora PostgreSQL cluster as DB for Odoo 12
After database failover we face with permanent "ERROR: cannot execute INSERT in a read-only transaction".
Connect from Odoo ends up at the reader
> erpdb-cluster Reader instance Aurora PostgreSQL eu-central-1c 2 Connections
This lasts until Odoo is restarted.
The odoo connects to a cluster DNS DB hostname, which points to the writer via DNS.
During failover, the writer role switches to reader, and the former writer becomes a reader.
AWS claimed that DNS switching occurs within 5 seconds.
Root cause:
During failover, the tcp connection to the DB is reset and established.
However, the DNS hasn't switched to the new IP address yet (the system resolver will return new IP address in few second after)
Therefore, the connection is established with the same IP where the reader resides.
What solutions do you see for this problem?
Thank you