Skip to content

Automatically Set MySQL/MariaDB Session Transaction Isolation to "Read Committed" for Upon Reconnection #17947

@GuyPaddock

Description

@GuyPaddock

Is your feature request related to a problem? Please describe.
As someone responsible for deploying and maintaining our Nextcloud deployment, I'd like it if Nextcloud automatically set the transaction isolation level to "READ COMMITTED" when reconnecting to the database during a long-running request so that I don't have to set it at the server level, affecting all other applications using the same application server.

Describe the solution you'd like
It appears that Nextcloud automatically sets the transaction isolation level to "Read Committed" whenever Nextcloud opens a database connection to MySQL or MariaDB, but it doesn't restore this if the connection dies and Nextcloud has to reconnect.

This transaction isolation level is necessary to ensure that the transaction isolation level is as it needs to be for Nextcloud not to deadlock the DB on file operations.

Describe alternatives you've considered
Change the global default value for transaction_isolation on the MySQL server per the installation docs, and then either:

  1. Modify all other applications that use the same database server to set their transaction isolation levels as needed for their own purposes; OR
  2. Use a separate database server for other applications.

Neither option is great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    4. to releaseReady to be released and/or waiting for tests to finishenhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions