-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Two database connections and missing transaction isolation level for read operations #45003
Comments
Stack traces
so it's the Doctrine primary/replica connection class that switches to the primary once we start a transaction. The class doesn't factor in that we only have primary and no replica and still opens a separate connection. We set the primary parameters as the first replica if there is no replica config. Doctrine requires this for the Primary/Replica class, else it throws |
I think the best fix would be to only subclass PrimaryReadReplicaConnection when db replicas are actually available and use the simple Doctrine Connection instead. |
Good finding 👍 |
We've got some other bugs in this area of code too:
Both of the above have the same underlying cause. #45257 is particularly nasty since it not only doesn't copy the source database, but then it clears out the (wrong) entire database schema (!). We need to at a minimum clean up the parameter value merging for #45257 (or whatever is the appropriate approach with the new replica stuff now being in mainline). Ideally before next maintenance release (which admittedly is cutting it close and I'm not offering up a fix since I haven't had the time to look deep enough at that area of code so far and doubt I'll have the time to do in the next day or so). |
Bug description
I am capturing all queries of my MariaDB installation and noticed a strange query pattern for simple Nextcloud requests:
Steps to reproduce
Expected behavior
Single connection and read queries use READ COMMITTED too, not the global database default.
Installation method
None
Nextcloud Server version
29
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
Related to #41998.
The text was updated successfully, but these errors were encountered: