How manage partition rotating in real time on Galera Cluster?
I am catch from time to time metadata lock while dropping or adding partitions on a table. I have 3 nodes in a cluster and all application connections going to first node through load balance. If first node goes down connection switch to second node.
For partitioning I use the next SP:
CREATE DEFINER=`root`@`localhost` PROCEDURE `manage_partitions`()
BEGIN
if @@GLOBAL.wsrep_on = 1
then SET wsrep_on=0; end if;
SET sql_log_bin = 0;
----- > Manage partitions here
SET sql_log_bin = 1;
if @@GLOBAL.wsrep_on = 1
then SET wsrep_on=1; end if;
END
I execute this piece of code on each node on different time. And some time catch metadata lock and only kill process which create/drop partition can unfreeze server.
So, DBAs, How you manage partition rotations in MariaDB with Galera clusetr in real time? I use MariaDB version - 10.1.13.
Mike.