From 794dc2050a6581169170940a2a26fc8404043e7c Mon Sep 17 00:00:00 2001 From: Jan Klare Date: Mon, 14 Mar 2016 11:58:40 +0100 Subject: [PATCH] percona cluster nodes should be sorted * the nodes written to the my.conf returned from search should be sorted to avoid restarting mysql just because reordering the nodes in the template Change-Id: I3cd70ca818be18f926b384feb1a592cb3b137ccd --- recipes/percona-cluster-server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/percona-cluster-server.rb b/recipes/percona-cluster-server.rb index 72e5b2e..1dd4000 100644 --- a/recipes/percona-cluster-server.rb +++ b/recipes/percona-cluster-server.rb @@ -41,7 +41,7 @@ node.normal['percona']['cluster']['wsrep_provider_options'] = "\"gmcast.listen_a # query_cache is not supported with wsrep node.normal['percona']['server']['query_cache_size'] = 0 # find all nodes in the percona cluster -cluster_nodes = search(:node, 'recipes:"percona\:\:cluster"') +cluster_nodes = search(:node, 'recipes:"percona\:\:cluster"').sort # if it's the first node make sure that wsrep_cluster_address is set to nothing to be able to bootstrap. is_first_node = cluster_nodes.empty? || (cluster_nodes.size == 1 && cluster_nodes.first['fqdn'] == node['fqdn']) if is_first_node