cluster_ready() returns False if the leader changed after the deployment

Bug #1691510 reported by Felipe Reyes
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack RabbitMQ Server Charm
Fix Released
High
Felipe Reyes

Bug Description

cluster_ready() relies on the 'clustered' key to decide if a related peer joined the cluster or not[0], but the leader during the first deployment doesn't set itself as clustered, [1] will be always True for the leader so it will never reach to relation_set(clustered=....)

Workaround:

* Set clustered property
  $ juju run --application rabbitmq-server 'relation-set -r `relation-ids cluster` clustered=`hostname`'

[0] https://github.com/openstack/charm-rabbitmq-server/blob/stable/17.02/hooks/rabbit_utils.py#L997
[1] https://github.com/openstack/charm-rabbitmq-server/blob/stable/17.02/hooks/rabbit_utils.py#L406

Felipe Reyes (freyes)
Changed in charm-rabbitmq-server:
assignee: nobody → Felipe Reyes (freyes)
tags: added: backport-potential
tags: added: stable-backport
removed: backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-rabbitmq-server (master)

Fix proposed to branch: master
Review: https://review.openstack.org/467684

Changed in charm-rabbitmq-server:
status: New → In Progress
Changed in charm-rabbitmq-server:
milestone: none → 17.08
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-rabbitmq-server (master)

Reviewed: https://review.openstack.org/467684
Committed: https://git.openstack.org/cgit/openstack/charm-rabbitmq-server/commit/?id=6a66fd16124c60d056fc710c1f47df6855c8ba1e
Submitter: Jenkins
Branch: master

commit 6a66fd16124c60d056fc710c1f47df6855c8ba1e
Author: Felipe Reyes <email address hidden>
Date: Wed May 24 12:22:37 2017 -0400

    Set clustered atrribute in the cluster's leader

    When forming the cluster the leader node (defined by
    leader_node_hostname) is the one that won't join a cluster, all the
    other peers will join this leader, this prevented the leader from
    setting the clustered attribute in the cluster relation.

    This patch makes all the units to run the cluster_with() function
    and cluster_with() skips 'rabbitmqctl join_cluster' for the nodes
    already present in the running section of 'rabbitmqctl cluster_status'
    and sets the clustered attribute if it hasn't been set already.

    Also cluster_with() is called within the upgrade-charm hook to allow
    existing deployments set the attribute if needed.

    Change-Id: I234046de279e1c28f7ad640c2cd7c641e864525b
    Closes-Bug: 1691510

Changed in charm-rabbitmq-server:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-rabbitmq-server (stable/17.02)

Fix proposed to branch: stable/17.02
Review: https://review.openstack.org/468533

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-rabbitmq-server (stable/17.02)

Reviewed: https://review.openstack.org/468533
Committed: https://git.openstack.org/cgit/openstack/charm-rabbitmq-server/commit/?id=2da1f432b1bf16a7da39b6c9948476021603b7b0
Submitter: Jenkins
Branch: stable/17.02

commit 2da1f432b1bf16a7da39b6c9948476021603b7b0
Author: Felipe Reyes <email address hidden>
Date: Wed May 24 12:22:37 2017 -0400

    Set clustered atrribute in the cluster's leader

    When forming the cluster the leader node (defined by
    leader_node_hostname) is the one that won't join a cluster, all the
    other peers will join this leader, this prevented the leader from
    setting the clustered attribute in the cluster relation.

    This patch makes all the units to run the cluster_with() function
    and cluster_with() skips 'rabbitmqctl join_cluster' for the nodes
    already present in the running section of 'rabbitmqctl cluster_status'
    and sets the clustered attribute if it hasn't been set already.

    Also cluster_with() is called within the upgrade-charm hook to allow
    existing deployments set the attribute if needed.

    Revision 708 from lp:charm-helpers needed to allow functional tests execute
    'juju actions'.

    Change-Id: I234046de279e1c28f7ad640c2cd7c641e864525b
    Closes-Bug: 1691510
    (cherry picked from commit 6a66fd16124c60d056fc710c1f47df6855c8ba1e)

James Page (james-page)
Changed in charm-rabbitmq-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.