Interview Prep/Real-World Interview/Cloud provider issues

After an Aurora failover, writes fail for 10 minutes with "ERROR: cannot execute INSERT in a read-only transaction", even though the cluster shows a healthy new writer.

IntermediateTroubleshootingCloud provider issues
Answer

Likely causes → The app is still connected to the old writer, which came back as a reader. Its pool keeps those connections, or the client cached the old IP behind the cluster endpoint. Pointing writes at an instance endpoint or the reader endpoint by mistake causes the same error.

Diagnose →

aws rds describe-db-clusters --db-cluster-identifier prod --query 'DBClusters[0].DBClusterMembers'
dig +short prod.cluster-abc123.ap-south-1.rds.amazonaws.com

Check the app's connection string and pool settings.

Fix → Recycle the connection pools (rolling restart). Make sure writes use the cluster (writer) endpoint.

Prevent → Configure the pool to drop connections on read-only errors and set a short maxLifetime, use a failover-aware driver (AWS Advanced JDBC Wrapper) or RDS Proxy, keep JVM DNS TTL low, and test failover regularly with aws rds failover-db-cluster.

All Real-World Interview questions Roadmap: Interview readiness

More on Cloud provider issues