Skip to content

No need to change the default transaction isolation level globally on a server #9145

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,19 @@ requires that you install and set up the server software first.
scope of this document. Please refer to the documentation for your specific
database choice for instructions.

.. _db-transaction-label:

Database "READ COMMITTED" transaction isolation level
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As discussed above Nextcloud is using the ``TRANSACTION_READ_COMMITTED`` transaction isolation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, can we keep this section to have the transaction isolation level documented somewhere? I guess the rest can go.

level. Some database configurations are enforcing other transaction isolation levels. To avoid
data loss under high load scenarios (e.g. by using the sync client with many clients/users and
many parallel operations) you need to configure the transaction isolation level accordingly.
Please refer to the `MySQL manual <https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html>`_
for detailed information.

Parameters
----------
For setting up Nextcloud to use any database, use the instructions in :doc:`../installation/installation_wizard`. You should not have to edit the respective values in the :file:`config/config.php`. However, in special cases (for example, if you want to connect your Nextcloud instance to a database created by a previous installation of Nextcloud), some modification might be required.

Configuring a MySQL or MariaDB database
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you decide to use a MySQL or MariaDB database, ensure the following:

* The transaction isolation level is set to "READ-COMMITTED" in your MariaDB server configuration :file:`/etc/mysql/my.cnf` to persist even after a restart of your database server.
* The **binlog_format** is set to "ROW" or "MIXED" ("MIXED" is the default since MariaDB 10.2.4) in your MariaDB server configuration :file:`/etc/mysql/my.cnf` to persist even after a restart of your database server.

Verify the **transaction_isolation** and **binlog_format**:
Verify the **binlog_format**:

::

[mysqld]
...
transaction_isolation = READ-COMMITTED
binlog_format = ROW
...

Expand Down Expand Up @@ -84,7 +67,6 @@ Your :file:`/etc/mysql/my.cnf` could look like this:
[mysqld]
character_set_server = utf8mb4
collation_server = utf8mb4_general_ci
transaction_isolation = READ-COMMITTED
binlog_format = ROW
innodb_large_prefix=on
innodb_file_format=barracuda
Expand Down
8 changes: 0 additions & 8 deletions admin_manual/configuration_server/security_setup_warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,3 @@ Some files have not passed the integrity check
----------------------------------------------

Please refer to the :ref:`code_signing_fix_warning_label` documentation how to debug this issue.

Your database does not run with "READ COMMITED" transaction isolation level
---------------------------------------------------------------------------

"Your database does not run with "READ COMMITED" transaction isolation level.
This can cause problems when multiple actions are executed in parallel."

Please refer to :ref:`db-transaction-label` how to configure your database for this requirement.
3 changes: 1 addition & 2 deletions admin_manual/installation/system_requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ Database requirements for MySQL / MariaDB
The following is currently required if you're running Nextcloud together with a MySQL / MariaDB database:

* InnoDB storage engine (MyISAM is not supported)
* "READ COMMITED" transaction isolation level (See: :ref:`db-transaction-label`)
* Disabled or BINLOG_FORMAT = ROW configured Binary Logging (See: https://dev.mysql.com/doc/refman/5.7/en/binary-log-formats.html)
* Disabled, BINLOG_FORMAT = ROW or BINLOG_FORMAT = MIXED configured Binary Logging (See: https://dev.mysql.com/doc/refman/5.7/en/binary-log-formats.html)
* For **Emoji (UTF8 4-byte) support** see :doc:`../configuration_database/mysql_4byte_support`

Desktop client
Expand Down