Bug Report
| Q |
A |
| Version |
4.4.3 |
| Previous Version if the bug is a regression |
N/A |
Summary
The only documentation I could find regarding keepReplica is from https://symfony.com/doc/current/doctrine/dbal.html#using-primary-replica-connections-read-replicas:
Set the keep_replica option to true to keep using the replica for read queries even after a write operation.
Current behavior
Setting keep_replica to true, the connection still uses the primary for a read query after writes.
Expected behavior
Given the documentation, I was expecting the replica to be used instead.
How to reproduce
- Configure a connection with replicas and
keep_replica to true.
- Run some write queries to connect to the primary
- Run a read query
Is calling PrimaryReadReplicaConnection::ensureConnectedToReplica() mandatory for this feature to work? If yes that would be a documentation issue.
Or should PrimaryReadReplicaConnection override executeQuery to call it itself?
Bug Report
Summary
The only documentation I could find regarding
keepReplicais from https://symfony.com/doc/current/doctrine/dbal.html#using-primary-replica-connections-read-replicas:Current behavior
Setting
keep_replicatotrue, the connection still uses the primary for a read query after writes.Expected behavior
Given the documentation, I was expecting the replica to be used instead.
How to reproduce
keep_replicatotrue.Is calling
PrimaryReadReplicaConnection::ensureConnectedToReplica()mandatory for this feature to work? If yes that would be a documentation issue.Or should
PrimaryReadReplicaConnectionoverrideexecuteQueryto call it itself?