Enabling mongo-db snap feature-flag causes deployments to fail

Bug #1819004 reported by Achilleas Anagnostopoulos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Tim McNamara

Bug Description

When enabling the "mongodb-snap" feature flag, a controller can be
successfully bootstrapped using the *develop* branch but bundle deployments
fail as the deployer worker *always* tries to use snap as the deployment
service implementation instead of the expected systemd.

To replicate:
```
export JUJU_DEV_FEATURE_FLAGS=mongodb-snap
juju bootstrap lxd lxd-test

cat > bundle.yaml <<EOT
relations:
- - keystone:shared-db
  - mysql:shared-db
series: bionic
services:
  keystone:
    annotations:
      gui-x: '500'
      gui-y: '0'
    charm: cs:keystone
    num_units: 1
    options:
      admin-password: openstack
      openstack-origin: cloud:bionic-rocky
      worker-multiplier: 0.25
  mysql:
    annotations:
      gui-x: '0'
      gui-y: '250'
    charm: cs:percona-cluster
    num_units: 1
    options:
      max-connections: 20000
      innodb-buffer-pool-size: 50%
EOT
juju deploy bundle.yaml
```

`juju debug-log` should eventually contain entries like:
machine-0: 13:11:18 INFO juju.worker.deployer checking unit "keystone/0"
machine-0: 13:11:18 INFO juju.worker.deployer deploying unit "keystone/0"
machine-1: 13:11:18 INFO juju.worker.deployer checking unit "mysql/0"
machine-1: 13:11:18 INFO juju.worker.deployer deploying unit "mysql/0"
machine-1: 13:11:18 ERROR juju.worker.dependency "unit-agent-deployer" manifold worker returned unexpected error: exit status 1
machine-0: 13:11:18 ERROR juju.worker.dependency "unit-agent-deployer" manifold worker returned unexpected error: exit status 1

Changed in juju:
importance: Undecided → Low
Changed in juju:
assignee: Achilleas Anagnostopoulos (achilleasa) → Ian Booth (wallyworld)
Ian Booth (wallyworld)
Changed in juju:
importance: Low → High
status: New → Triaged
milestone: none → 2.6-beta1
assignee: Ian Booth (wallyworld) → Tim McNamara (tim-clicks)
Revision history for this message
Tim McNamara (tim-clicks) wrote :

The cause of this issue is that the underlying OS is running two init systems concurrently, and our service abstraction doesn't handle that well.

Specifically, snap is managing the services provided by the juju-db snap, whereas the rest of the services need to be managed by systemd. discoverInitSystem() at service/discovery.go:26 and its related functions does not have any context about which service is intended to be managed, as thus gets confused.

Revision history for this message
Tim McNamara (tim-clicks) wrote :
Revision history for this message
Tim McNamara (tim-clicks) wrote :

Strategy decided for resolving this issue was to remove all snap functionality from the service/discovery.go machinery and to allow mongo/service.go to handle snaps as a special case itself.

Changed in juju:
milestone: 2.6-beta1 → 2.6-beta2
Changed in juju:
status: Triaged → Fix Committed
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.