Project

General

Profile

MySQL configuration » History » Version 1

Marius BĂLTEANU, 2023-11-20 23:30

1 1 Marius BĂLTEANU
h1. MySQL configuration
2
3
MySQL 5.6, 5.7, 8.0 and 8.1 have known issues in case of concurrent modifications to the issue nested set, i.e. by parallel modification of various issues' parent_id). More details can be found in issue #39437 and all the related issues to that ticket. 
4
5
Redmine higher or equal with version:"5.1.1" contains important fixes to mitigate this issue, but those fixes requires also to change the @transaction_isolation@ to @READ COMMITTED@ in order to properly work. The default MySQL transaction isolation level is @REPEATABLE READ@ according to the "official documentation":https://dev.mysql.com/doc/refman/8.0/en/innodb-transaction-isolation-levels.html.
6
7
There are at least two ways to set this in persistent way:
8
9
10
h3. 1. Change Redmine database configuration file
11
12
Add to @database.yml@ configuration file the key @variables@ with @transaction_isolation: "READ-COMMITTED"@ under it as below:
13
14
<pre><code class="yml">
15
production:
16
  adapter: mysql2
17
  database: redmine
18
  host: localhost
19
  username: root
20
  password: ""
21
  # Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
22
  encoding: utf8mb4
23
  variables:
24
    transaction_isolation: "READ-COMMITTED"
25
</code></pre>
26
27
h3. 2. Change @transaction_isolation@ in the MySQL configuration file on the server
28
29
<pre><code class="conf">
30
transaction_isolation="READ-COMMITTED"
31
</code></pre>
32
33
* The path to this file depends on the Operating System, for example, in Ubuntu is @/etc/mysql/conf.d/mysql.cnf@.
34
* Changing this setting, requires a server restart. If you don't want to restart the server, the setting can be applied also at the runtime by running the following query: @SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;@, but it is importat to make also the change in the configuration file in order to persist the setting after restart.
35
* All major cloud providers allow changing this setting from the cloud administration page.
36
37
As any other change made to a production system, is it strongly recommended to test this change before making it in the production. In case of a more advanced setup with replica, this change can may also change the binary log format of your server because only row-based binary logging is supported with the @READ COMMITTED@ isolation level