Do not depend on bootstrap_nodeid for any pacemaker profile
authorMichele Baldessari <michele@acksyn.org>
Tue, 17 Jan 2017 17:17:38 +0000 (18:17 +0100)
committerMichele Baldessari <michele@acksyn.org>
Wed, 18 Jan 2017 10:53:16 +0000 (11:53 +0100)
When we create a pacemaker resource it must happen from a single node.
If it happens from multiple nodes an immediate error will be returned by
pcs.

For the pacemaker roles we enforce this by leveraging the recently
introduced <SERVICE_NAME_bootstrap_short_node_name> which gives us
the first hostname per-service, regardless of the role.
(introduced via I03e8685f939e8ae1fcd8b16883b559615042505d)

With this approach if a pacemaker service belongs to two different
roles (say role Controller on node A and role galera on node B), it
will only create the resource from one of the two and not both (which
would return an error).

Only setting Partial-Bug for this one, because it addresses the issue
from the pacemaker resource creation POV (which is always affected). But
the issue itself is a race that we're theoretically affected by since
the composable roles work landed. While I have tried to fix the more
general case in previous attempts, I think it is best if we start a
discussion on how to fix it, because each approach has a bunch of
potential drawbacks and is quite invasive on how we do things. A
discussion slot for this has been proposed for the Atlanta PTG.

Change-Id: I662398cab60d523d204b57a5674ca8f5c0f2e68a
Partial-Bug: #1615983

manifests/profile/base/pacemaker.pp
manifests/profile/pacemaker/cinder/backup.pp
manifests/profile/pacemaker/cinder/volume.pp
manifests/profile/pacemaker/database/mysql.pp
manifests/profile/pacemaker/database/redis.pp
manifests/profile/pacemaker/haproxy.pp
manifests/profile/pacemaker/manila.pp
manifests/profile/pacemaker/rabbitmq.pp

index 19eb52b..671f1e7 100644 (file)
@@ -31,7 +31,7 @@ class tripleo::profile::base::pacemaker (
     try_sleep => 3,
   }
 
-  if $::hostname == downcase(hiera('bootstrap_nodeid')) {
+  if $::hostname == downcase(hiera('pacemaker_short_bootstrap_node_name')) {
     $pacemaker_master = true
   } else {
     $pacemaker_master = false
index 63988d6..4e33a34 100644 (file)
@@ -20,7 +20,7 @@
 #
 # [*bootstrap_node*]
 #   (Optional) The hostname of the node responsible for bootstrapping tasks
-#   Defaults to hiera('bootstrap_nodeid')
+#   Defaults to hiera('cinder_backup_short_bootstrap_node_name')
 #
 # [*step*]
 #   (Optional) The current step in deployment. See tripleo-heat-templates
@@ -28,7 +28,7 @@
 #   Defaults to hiera('step')
 #
 class tripleo::profile::pacemaker::cinder::backup (
-  $bootstrap_node = hiera('bootstrap_nodeid'),
+  $bootstrap_node = hiera('cinder_backup_short_bootstrap_node_name'),
   $step           = hiera('step'),
 ) {
 
index 46e8b79..b03a1f4 100644 (file)
@@ -20,7 +20,7 @@
 #
 # [*bootstrap_node*]
 #   (Optional) The hostname of the node responsible for bootstrapping tasks
-#   Defaults to hiera('bootstrap_nodeid')
+#   Defaults to hiera('cinder_volume_short_bootstrap_node_name')
 #
 # [*step*]
 #   (Optional) The current step in deployment. See tripleo-heat-templates
@@ -28,7 +28,7 @@
 #   Defaults to hiera('step')
 #
 class tripleo::profile::pacemaker::cinder::volume (
-  $bootstrap_node = hiera('bootstrap_nodeid'),
+  $bootstrap_node = hiera('cinder_volume_short_bootstrap_node_name'),
   $step           = hiera('step'),
 ) {
   Service <| tag == 'cinder::volume' |> {
index edd09bd..3506cb1 100644 (file)
 #
 # === Parameters
 #
+# [*bootstrap_node*]
+#   (Optional) The hostname of the node responsible for bootstrapping tasks
+#   Defaults to hiera('mysql_short_bootstrap_node_name')
+#
 # [*bind_address*]
 #   (Optional) The address that the local mysql instance should bind to.
 #   Defaults to $::hostname
 #   Defaults to hiera('step')
 #
 class tripleo::profile::pacemaker::database::mysql (
+  $bootstrap_node     = hiera('mysql_short_bootstrap_node_name'),
   $bind_address       = $::hostname,
   $gmcast_listen_addr = hiera('mysql_bind_host'),
   $step               = hiera('step'),
 ) {
-  if $::hostname == downcase(hiera('bootstrap_nodeid')) {
+  if $::hostname == downcase($bootstrap_node) {
     $pacemaker_master = true
   } else {
     $pacemaker_master = false
@@ -100,6 +105,7 @@ class tripleo::profile::pacemaker::database::mysql (
   }
 
   class { '::tripleo::profile::base::database::mysql':
+    bootstrap_node          => $bootstrap_node,
     manage_resources        => false,
     remove_default_accounts => $remove_default_accounts,
     mysql_server_options    => $mysqld_options,
index 37c36aa..7490fa0 100644 (file)
@@ -20,7 +20,7 @@
 #
 # [*bootstrap_node*]
 #   (Optional) The hostname of the node responsible for bootstrapping tasks
-#   Defaults to hiera('bootstrap_nodeid')
+#   Defaults to hiera('redis_short_bootstrap_node_name')
 #
 # [*enable_load_balancer*]
 #   (Optional) Whether load balancing is enabled for this cluster
@@ -37,7 +37,7 @@
 #   or 10240 (default in redis systemd limits)
 #
 class tripleo::profile::pacemaker::database::redis (
-  $bootstrap_node       = hiera('bootstrap_nodeid'),
+  $bootstrap_node       = hiera('redis_short_bootstrap_node_name'),
   $enable_load_balancer = hiera('enable_load_balancer', true),
   $step                 = hiera('step'),
   $redis_file_limit     = hiera('redis_file_limit', 10240),
index 605bb15..b326761 100644 (file)
@@ -20,7 +20,7 @@
 #
 # [*bootstrap_node*]
 #   (Optional) The hostname of the node responsible for bootstrapping tasks
-#   Defaults to hiera('bootstrap_nodeid')
+#   Defaults to hiera('haproxy_short_bootstrap_node_name')
 #
 # [*enable_load_balancer*]
 #   (Optional) Whether load balancing is enabled for this cluster
@@ -32,7 +32,7 @@
 #   Defaults to hiera('step')
 #
 class tripleo::profile::pacemaker::haproxy (
-  $bootstrap_node       = hiera('bootstrap_nodeid'),
+  $bootstrap_node       = hiera('haproxy_short_bootstrap_node_name'),
   $enable_load_balancer = hiera('enable_load_balancer', true),
   $step                 = hiera('step'),
 ) {
index 0bf78af..547a86f 100644 (file)
@@ -38,7 +38,7 @@
 #
 # [*bootstrap_node*]
 #   (Optional) The hostname of the node responsible for bootstrapping tasks
-#   Defaults to hiera('bootstrap_nodeid')
+#   Defaults to hiera('manila_share_short_bootstrap_node_name')
 #
 # [*step*]
 #   (Optional) The current step in deployment. See tripleo-heat-templates
@@ -50,7 +50,7 @@ class tripleo::profile::pacemaker::manila (
   $backend_netapp_enabled  = hiera('manila_backend_netapp_enabled', false),
   $backend_cephfs_enabled  = hiera('manila_backend_cephfs_enabled', false),
   $ceph_mds_enabled        = hiera('ceph_mds_enabled', false),
-  $bootstrap_node          = hiera('bootstrap_nodeid'),
+  $bootstrap_node          = hiera('manila_share_short_bootstrap_node_name'),
   $step                    = hiera('step'),
 ) {
   if $::hostname == downcase($bootstrap_node) {
index dba01e3..85ebe34 100644 (file)
@@ -20,7 +20,7 @@
 #
 # [*bootstrap_node*]
 #   (Optional) The hostname of the node responsible for bootstrapping tasks
-#   Defaults to hiera('bootstrap_nodeid')
+#   Defaults to hiera('rabbitmq_short_bootstrap_node_name')
 #
 # [*erlang_cookie*]
 #   (Optional) Content of erlang cookie.
@@ -42,7 +42,7 @@
 #   Defaults to hiera('step')
 #
 class tripleo::profile::pacemaker::rabbitmq (
-  $bootstrap_node = hiera('bootstrap_nodeid'),
+  $bootstrap_node = hiera('rabbitmq_short_bootstrap_node_name'),
   $erlang_cookie  = hiera('rabbitmq::erlang_cookie'),
   $user_ha_queues = hiera('rabbitmq::nr_ha_queues', 0),
   $rabbit_nodes   = hiera('rabbitmq_node_names'),