Relations between subordinates don't work in 2.2

Bug #1702636 reported by William Grant
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Undecided
Christian Muirhead

Bug Description

2.1.3:
  $ juju deploy cs:rabbitmq-server rabbitmq-server
  $ juju deploy cs:nrpe nrpe
  $ juju deploy cs:canonical-livepatch canonical-livepatch
  $ juju add-relation rabbitmq-server nrpe
  $ juju add-relation rabbitmq-server canonical-livepatch
  $ juju add-relation nrpe canonical-livepatch
  $ juju status | grep livepatch.*nrpe
  nrpe-external-master canonical-livepatch nrpe subordinate
  $ juju run --unit=nrpe/0 relation-ids nrpe-external-master
  nrpe-external-master:1
  nrpe-external-master:3
  $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:1"
  rabbitmq-server/0
  $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:3"
  canonical-livepatch/0

2.2.0 (2.2.1 is the same):
  $ juju deploy cs:rabbitmq-server
  $ juju deploy cs:nrpe
  $ juju deploy cs:canonical-livepatch
  $ juju add-relation rabbitmq-server nrpe
  $ juju add-relation rabbitmq-server canonical-livepatch
  $ juju add-relation canonical-livepatch nrpe
  $ juju status | grep livepatch.*nrpe
  nrpe-external-master canonical-livepatch nrpe subordinate
  $ juju run --unit=nrpe/0 relation-ids nrpe-external-master
  nrpe-external-master:1
  $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:1"
  rabbitmq-server/0

The relation's unitcount in the DB remains at 0. I guess the fixes to not enter unrelated subordinate scopes also took out related subordinate scopes.

This thoroughly confuses charms on upgrade to 2.2.1, as the relations disappear without hooks firing. Something like this might be a reasonable workaround for the canonical-livepatch/nrpe case:

juju run --application canonical-livepatch "sudo apt install sqlite3; sudo sqlite3 /var/lib/juju/agents/unit-canonical-livepatch-*/charm/.unit-state.db \"DELETE FROM kv WHERE key IN ('reactive.conversations.nrpe-external-master.global', 'reactive.states.nrpe-external-master.available');\"; sudo rm /var/lib/nagios/export/*_check_canonical-livepatch.cfg"

William Grant (wgrant)
description: updated
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1702636] [NEW] Relations between subordinates don't work in 2.2
Download full text (4.8 KiB)

I believe Christian is actively working on fixing this for 2.2.2.

John
=:->

On Thu, Jul 6, 2017 at 12:27 PM, William Grant <email address hidden>
wrote:

> Public bug reported:
>
> 2.1.3:
> $ juju deploy cs:rabbitmq-server rabbitmq-server
> $ juju deploy cs:nrpe nrpe
> $ juju deploy cs:canonical-livepatch canonical-livepatch
> $ juju add-relation rabbitmq-server nrpe
> $ juju add-relation rabbitmq-server canonical-livepatch
> $ juju add-relation nrpe canonical-livepatch
> $ juju status | grep livepatch.*nrpe
> nrpe-external-master canonical-livepatch nrpe
> subordinate
> $ juju run --unit=nrpe/0 relation-ids nrpe-external-master
> nrpe-external-master:1
> nrpe-external-master:3
> $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:1"
> rabbitmq-server/0
> $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:3"
> canonical-livepatch/0
>
> 2.2.0 (2.2.1 is the same):
> $ juju deploy cs:rabbitmq-server
> $ juju deploy cs:nrpe
> $ juju deploy cs:canonical-livepatch
> $ juju add-relation rabbitmq-server nrpe
> $ juju add-relation rabbitmq-server canonical-livepatch
> $ juju add-relation canonical-livepatch nrpe
> $ juju status | grep livepatch.*nrpe
> nrpe-external-master canonical-livepatch nrpe
> subordinate
> $ juju run --unit=nrpe/0 relation-ids nrpe-external-master
> nrpe-external-master:1
> $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:1"
> rabbitmq-server/0
>
> The relation's unitcount in the DB remains at 0. I guess the fixes to
> not enter unrelated subordinate scopes also took out related subordinate
> scopes.
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> ** Description changed:
>
> 2.1.3:
> - $ juju deploy cs:rabbitmq-server rabbitmq-server
> - $ juju deploy cs:nrpe nrpe
> - $ juju deploy cs:canonical-livepatch canonical-livepatch
> - $ juju add-relation rabbitmq-server nrpe
> - $ juju add-relation rabbitmq-server canonical-livepatch
> - $ juju add-relation nrpe canonical-livepatch
> - $ juju status | grep livepatch.*nrpe
> - nrpe-external-master canonical-livepatch nrpe
> subordinate
> - $ juju run --unit=nrpe/0 relation-ids nrpe-external-master
> - nrpe-external-master:1
> - nrpe-external-master:3
> - $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:1"
> - rabbitmq-server/0
> - $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:3"
> - canonical-livepatch/0
> + $ juju deploy cs:rabbitmq-server rabbitmq-server
> + $ juju deploy cs:nrpe nrpe
> + $ juju deploy cs:canonical-livepatch canonical-livepatch
> + $ juju add-relation rabbitmq-server nrpe
> + $ juju add-relation rabbitmq-server canonical-livepatch
> + $ juju add-relation nrpe canonical-livepatch
> + $ juju status | grep livepatch.*nrpe
> + nrpe-external-master canonical-livepatch nrpe
> subordinate
> + $ juju run --unit=nrpe/0 relation-ids nrpe-external-master
> + nrpe-external-master:1
> + nrpe-external-master:3
> + $ juju run --unit=nrpe/0 "relation-list -r nrpe-external-master:1"
> + rabbitmq-server/0
> + $ juju run --unit=nrpe/0 "relation-list -r nrpe-...

Read more...

William Grant (wgrant)
description: updated
Revision history for this message
Christian Muirhead (2-xtian) wrote :

PR to fix the filtering: https://github.com/juju/juju/pull/7590
It turned out that subordinate-subordinate relations would still prevent the principal app from being destroyed, this is fixed in: https://github.com/juju/juju/pull/7603

Changed in juju:
status: New → In Progress
assignee: nobody → Christian Muirhead (2-xtian)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
milestone: none → 2.2.2
Changed in juju:
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.