The Problem HELP, HELP! My Percona XtraDB Cluster version: 5.7.31-31. Single Node is stuck in a joined state.
How to Speed Up Re Sync of Dropped Percona Xtradb Cluster Node appeared first on MariaDB.org
HELP, HELP! My Percona XtraDB Cluster version: 5.7.31-31. Single Node is stuck in a joined state.
I recently had the privilege to help a client with a fascinating issue.
NODE-B dropped out of the 3 node PXC cluster. It looked to be DISK IO that caused NODE-B to fall far behind and eventually be removed from the cluster. A restart of NODE-B allowed it to rejoin the cluster. NODE-B looked to have been down for about 4 hours. Once NODE-B was back as part of the cluster, it required a full SST.
When NODE-B stayed in a joint state for more than 12 hours, the client gave me a call. They were concerned that there was another issue with this cluster.
Before going forward, let’s make sure we know the CPU, RAM and Database Size.
Let’s gather some base information.
I pulled the below data once I understood what was going on.
SHOW STATUS LIKE ‘wsrep_last%';
+----------------------+----------+
| Variable_name | Value |
+----------------------+----------+
| wsrep_last_applied | 9802457 |
+----------------------+----------+
| wsrep_last_committed | 10103670 |
+----------------------+----------+
SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';+---------------------------+--------+
| Variable_name | Value |
+---------------------------+--------+
| wsrep_local_state_comment | Joined |
+---------------------------+--------+SHOW STATUS LIKE 'wsrep_cert_deps_distance';
+--------------------------+---------+
| Variable_name | Value |
+--------------------------+---------+
| wsrep_cert_deps_distance | 148.96 |
+--------------------------+---------+Pulled the below stats about one hour later.
NODE-B
+----------------------+----------+
| Variable_name | Value |
+----------------------+----------+
| wsrep_last_applied | 11901100 |
+----------------------+----------+
| wsrep_last_committed | 12801100 |
+----------------------+----------+NODE-A
+----------------------+----------+
| Variable_name | Value |
+----------------------+----------+
| wsrep_last_applied | 32900981 |
+----------------------+----------+
| wsrep_last_committed | 32901100 |
+----------------------+----------+As we can see above, NODE-B is processing write sets, but very slowly. The gcache files were being consumed very quickly, but being only 128MB in size would be slow going to get in sync. At this time, NODE-A and NODE-B seqno’s were separated by 20,100,000.
Now we know NODE-B is working as it should. At this rate, it could be a day or more to catch up.
Gathering Data and Coming up with a solutionI did a quick review of the PXC settings and found:
A scheduled 500 million row data extract started right about the time NODE-B re-joined the cluster. Now we have a large data load taking place plus a full SST to NODE-B.
Let’s now talk about how we helped to speed up NODE-B going from Joined to Synced.
RecommendationsWe upped the slave threads from 2 to 8. This is equal to the number of CPU’s on the system. Exceeding 8 threads could cause performance impact.
set global wsrep_slave_threads=8;Changed pxc_stright_mode from permissive too disabled. This was done to stop all PXC warnings being written to mysqld.log.
set global pxc_strick_mode = disabled;Relaxed ACID compliance. I made these changes to help NODE-B get back into a sync status quicker. I don’t recommend relaxing ACID compliance. This change should only be made if the client fully understands the risk.
set global innodb_flush_log_at_trx_commit = 2;
set global sync_binlog = 0;We let these changes bake in for about 2 hours. The client did not want to stop the data extract just yet. They were very open to the idea and did not want to lose the work that had already been completed. This did not bother me because I know the NODE-B was working as it should be. We let these changes bake in for about two hours.
ImprovementNODE-B
SHOW STATUS LIKE ‘wsrep_last%';
+----------------------+----------+
| Variable_name | Value |
+----------------------+----------+
| wsrep_last_applied | 32902200 |
+----------------------+----------+
| wsrep_last_committed | 40902100 |
+----------------------+----------+SHOW STATUS LIKE 'wsrep_cert_deps_distance';
+--------------------------+---------+
| Variable_name | Value |
+--------------------------+---------+
| wsrep_cert_deps_distance | 86.81 |
+--------------------------+---------+ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
+---------------------------+--------+
| Variable_name | Value |
+---------------------------+--------+
| wsrep_local_state_comment | Joined |
+---------------------------+--------+Now let’s look at our primary read/write NODE-A:
SHOW STATUS LIKE ‘wsrep_last%';
+----------------------+----------+
| Variable_name | Value |
+----------------------+----------+
| wsrep_last_applied | 43900992 |
+----------------------+----------+
| wsrep_last_committed | 43902200 |
+----------------------+----------+As we can now see, NODE-B is catching up much faster than before. The committed seqno is only 3,000,100 apart now, where the seqno had been this far apart 20,100,000.
Clearly, we made some significant progress. The client still was concerned about only having 2 of the 3 nodes up. We had a couple of choices, one stops the data extract or be patient for a bit longer. Clients choose patience. After another 2.5 hours, NODE-B had caught up to its peers and switched to Synced.
ConclusionNODE-B was stuck in a joined state due to a very undersized gcache; the default size had nev- er been changed.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Group Replication VS Percona XtraDB Cluster: The True Cost of Consistency | 0 | 5.62 | 15-06-2026 |
| 2 | Does Every PXC Node Need XtraBackup Installed? | 0 | 5.33 | 01-03-2026 |
| 3 | Lets be inSync! | 0 | 12.55 | 22-07-2021 |
| 4 | Meet the Percona Community team | 0 | 6.25 | 07-05-2026 |
| 5 | How to Migrate from MySQL Galera Cluster to Percona XtraDB Cluster | 0 | 7.69 | 22-07-2026 |
| 6 | Percona Bug Report: January 2024 | 0 | 10.76 | 19-02-2024 |
| 7 | The Percona Community Slack is open — come hang out | 0 | 3.75 | 02-06-2026 |
| 8 | Cross-site Disaster Recovery with Percona Operator for MySQL | 0 | 6.1 | 06-07-2026 |
| 9 | Percona Bug Report: October 2024 | 0 | 7.82 | 25-11-2024 |