@@ -276,18 +276,20 @@ Default: false
276
276
```
277
277
278
278
279
- RejectreadOnly causes mysql driver to reject read-only connections. This is
280
- specifically for AWS Aurora: During a failover, there seems to be a race
281
- condition on Aurora, where we get connected to the [ old master before
282
- failover] , i.e. the [ new read-only slave after failover] .
283
-
284
- Note that this should be a fairly rare case, as automatic failover normally
285
- happens when master is down, and the race condition shouldn't happen unless it
286
- comes back up online as soon as the failover is kicked off. But it's pretty
287
- easy to reproduce using a manual failover. In case this happens, we should
288
- reconnect to the Aurora cluster by returning a driver.ErrBadConnection.
289
-
290
- tl;dr: Set this if you are using Aurora.
279
+ RejectreadOnly causes the driver to reject read-only connections. This is for a
280
+ possible race condition during an automatic failover, where the mysql client
281
+ gets connected to a read-only replica after the failover.
282
+
283
+ Note that this should be a fairly rare case, as an automatic failover normally
284
+ happens when the primary is down, and the race condition shouldn't happen
285
+ unless it comes back up online as soon as the failover is kicked off. On the
286
+ other hand, when this happens, an mysql application can get stuck on a
287
+ read-only connection until restarted. It is however fairly easy to reproduce,
288
+ for example, using a manual failover on AWS Aurora's MySQL-compatible cluster.
289
+
290
+ If you are not relying on read-only transactions to reject writes that aren't
291
+ supposed to happen, setting this on some MySQL providers (such as AWS Aurora)
292
+ is safer for failovers.
291
293
292
294
293
295
##### ` strict `
0 commit comments