Hello. The secondary connection is only used if the application using oslo.db uses an async_reader which most project do not, and oslo.db cannot assume that the secondary can be used. For example: - Neutron creates a port in database using writer against primary - Neutron reads back the same port from database and with replication lag the secondary might return no record We recently merged [1] that allows setting synchronous_reader that can be used to influence this behaviour. Read the release note carefully and understand that if you set this to false you can have race conditions in applications where it cannot read the data it just wrote, for example as mentioned in that review you might need for example set wsrep_sync_wait if you use Galera clustering etc. It’s up to the applications (Keystone, Neutron etc) to ensure that they use and async_reader where appropriate but it can now be overriden as previously you would need to hack it in the application [2]. There are other use-cases for setting synchronous_reader=False (or as we did, in-code with [2]) when we migrated our Keystone databases but wanted to keep auth and read operations working. /Tobias [1] https://review.opendev.org/c/openstack/oslo.db/+/945415 [2] https://review.opendev.org/c/openstack/keystone/+/926776
On 30 Sep 2025, at 01:58, Tyler Wilson <tyler@ghosty.pw> wrote:
Hello All,
I'm trying to get keystone to respect my slave_connection configuration to use a local database node in my galera cluster. I have this set currently;
connection = mysql+pymysql://keystone:$PASSWORD@$DB_PRIMARY_WRITE_IP/keystone slave_connection = mysql+pymysql://keystone:$PASSWORD@$DB_LOCAL_READ_IP/keystone
However whenever I have this configured I still am getting queries sent to the $DB_PRIMARY_WRITE_IP for even simple things like 'openstack user list'. Is there some other configuration I need to set for this to go to the read DB node? I have query logging enabled on the mariadb side to confirm where the requests are going.
For troubleshooting I changed them both to the local DB node IP, and it can indeed process the sql requests fine.
Operating System: Ubuntu 24.04 Package Version: 2:25.0.0-0ubuntu1
Thanks for any assistance!