Database

How to Avoid MariaDB Galera Cluster stalls on ALTER

If you have trouble when upgrading table schema or alter table on MariaDB Galera Cluster, that make your database not response and then connection will over limit.

We have experienced with a situation in which you attempt to execute an ALTER statement on one node, but it takes a long time to execute–longer than expected.

During execution of ALTER statement, periode all of the other nodes stall, leading to performance problems throughout the cluster.

To to avoid MariaDB Galera Cluster stalls on ALTER table, you need to run an ALTER statement in this manner, you will need to execute the ALTER statement between a paid of SET statements on each node like SQL Command below:

Related Post
SET wsrep_OSU_method='RSU';
ALTER TABLE news ADD COLUMN views INT;
SET wsrep_OSU_method='TOI';

The explaination is the first SQL statement above will change the Schema Upgrade method to Rolling Schema Upgrade (i.e., RSU).

Then the second SQL statement represents an ALTER statement you want to execute.

Once that’s finished, the last statement will reset the Schema Upgrade method back to Total Order Isolation (i.e., TOI).

After you have done this on each node, the cluster will now run with the desired updates.

Recent Posts

How to fix yum update error thread.error: can’t start new thread

If you found error thread.error: can't start new thread on yum update command on CentOS…

5 months ago

How to securing Cockpit login with Google Two Factor Authenticator 2FA

Cockpit is a web-based graphical interface for servers, intended for everyone, especially those who are:…

8 months ago

How to install Cockpit on CentOS 7 / CentOS 9 Stream and configure Nginx reserve proxy

From cockpit-project.org, Cockpit is a web-based graphical interface for servers, intended for everyone, especially those…

10 months ago

How to install and configure Nginx with HTTP3 on CentOS 9 Stream / RHEL 9

We have been using Nginx with HTTP3 for more than 1 year on our production…

11 months ago

How to sync date time using Crony on CentOS 9 Stream / RHEL 9

On CentOS 7, to sync date time we often use NTPD. But on CentOS 9,…

11 months ago

How to install and enable REMI repository on CentOS 9 Stream

Remi repository is one of third-party repository that have latest update of PHP on Enterprise…

11 months ago