In summary: I think this is likely a side effect of calling config-get too late in the previous hook execution on ceph-osd/2, capturing the updated config value and writing it to .juju-persistent-config (that's how inter-hook-execution config changes are tracked in charmhelpers). As a result the next hook execution doesn't think that the value has changed.
This is due to the behavior in Juju where the result of a config-get call gets persisted at the time when a unit calls config-get rather than at the beginning of a hook execution (this is by design in Juju).
Specifically in the ceph-osd charm case the "source" config key value is used to determine the old version and compare it to the new version.
In summary: I think this is likely a side effect of calling config-get too late in the previous hook execution on ceph-osd/2, capturing the updated config value and writing it to .juju-persisten t-config (that's how inter-hook- execution config changes are tracked in charmhelpers). As a result the next hook execution doesn't think that the value has changed.
This is due to the behavior in Juju where the result of a config-get call gets persisted at the time when a unit calls config-get rather than at the beginning of a hook execution (this is by design in Juju).
Specifically in the ceph-osd charm case the "source" config key value is used to determine the old version and compare it to the new version.
My suggestion would be to take the installed version into account here rather than just relying on the previous config value persisted by charm-helpers in the previous hook execution. /github. com/openstack/ charm-ceph- osd/blob/ 43c93d9749d49af c991b3325a96a4c cc4def75f8/ hooks/ceph_ hooks.py# L134-L139 /github. com/openstack/ charm-ceph- osd/blob/ 43c93d9749d49af c991b3325a96a4c cc4def75f8/ lib/charms_ ceph/utils. py#L3179- L3187
https:/
https:/
https:/ /github. com/openstack/ charm-ceph- osd/blob/ 43c93d9749d49af c991b3325a96a4c cc4def75f8/ hooks/charmhelp ers/core/ hookenv. py#L392 (config.previous) /github. com/openstack/ charm-ceph- osd/blob/ 43c93d9749d49af c991b3325a96a4c cc4def75f8/ hooks/charmhelp ers/core/ hookenv. py#L345 (.juju- persistent- config)
https:/
More info from the deployment below:
ubuntu@ playground- cpe-9f305f1c- 537b-477e- afca-1ac364a24a fd:~$ juju run --application ceph-osd 'ceph-osd --version' 9cc913a0f5d3629 53a5d9c3ae0) mimic (stable) 57dc0567da126be 145106aa47e) luminous (stable) 9cc913a0f5d3629 53a5d9c3ae0) mimic (stable) 9cc913a0f5d3629 53a5d9c3ae0) mimic (stable) 9cc913a0f5d3629 53a5d9c3ae0) mimic (stable) 9cc913a0f5d3629 53a5d9c3ae0) mimic (stable) 9cc913a0f5d3629 53a5d9c3ae0) mimic (stable)
- Stdout: |
ceph version 13.2.8 (5579a94fafbc1f
UnitId: ceph-osd/1
- Stdout: |
ceph version 12.2.13 (584a20eb0237c6
UnitId: ceph-osd/2
- Stdout: |
ceph version 13.2.8 (5579a94fafbc1f
UnitId: ceph-osd/5
- Stdout: |
ceph version 13.2.8 (5579a94fafbc1f
UnitId: ceph-osd/0
- Stdout: |
ceph version 13.2.8 (5579a94fafbc1f
UnitId: ceph-osd/3
- Stdout: |
ceph version 13.2.8 (5579a94fafbc1f
UnitId: ceph-osd/4
- Stdout: |
ceph version 13.2.8 (5579a94fafbc1f
UnitId: ceph-osd/6
juju ssh ceph-osd/2
/var/log/ juju/unit- ceph-osd- 2.log uniter. operation executor.go:132 executing operation "run config-changed hook" for ceph-osd/2 uniter. runner runner.go:705 starting jujuc server {unix @/var/lib/ juju/agents/ unit-ceph- osd-2/agent. socket <nil>} 2-config- changed- 621961491343243 8912 2-config- changed- 621961491343243 8912 2-config- changed- 621961491343243 8912 2-config- changed- 621961491343243 8912 2-config- changed- 621961491343243 8912 2-config- changed- 621961491343243 8912 2-config- changed- 621961491343243 8912
# ...
2021-04-09 12:47:28 DEBUG juju.worker.
2021-04-09 12:47:28 DEBUG juju.worker.uniter agent.go:20 [AGENT-STATUS] executing: running config-changed hook
2021-04-09 12:47:28 DEBUG juju.worker.
2021-04-09 12:47:28 DEBUG jujuc server.go:211 running hook tool "juju-log" for ceph-osd/
2021-04-09 12:47:28 DEBUG juju-log Hardening function 'config_changed'
2021-04-09 12:47:28 DEBUG jujuc server.go:211 running hook tool "config-get" for ceph-osd/
2021-04-09 12:47:28 DEBUG jujuc server.go:211 running hook tool "juju-log" for ceph-osd/
2021-04-09 12:47:28 DEBUG juju-log No hardening applied to 'config_changed'
2021-04-09 12:47:28 DEBUG jujuc server.go:211 running hook tool "juju-log" for ceph-osd/
2021-04-09 12:47:28 INFO juju-log old_version: mimic
2021-04-09 12:47:28 DEBUG jujuc server.go:211 running hook tool "juju-log" for ceph-osd/
2021-04-09 12:47:28 INFO juju-log new_version: mimic
2021-04-09 12:47:28 DEBUG jujuc server.go:211 running hook tool "juju-log" for ceph-osd/
2021-04-09 12:47:28 WARNING juju-log Support for use of upstream ``apt_pkg`` module in conjunctionwith charm-helpers is deprecated since 2019-06-25
2021-04-09 12:47:29 DEBUG jujuc server.go:211 running hook tool "juju-log" for ceph-osd/
2021-04-09 12:47:29 ERROR juju-log Invalid upgrade path from mimic to mimic. Valid paths are: ['firefly -> hammer', 'hammer -> jewel', 'jewel -> luminous', 'luminous -> mimic', 'mimic -> nautilus', 'nautilus -> octopus']
root@obayifo:~# juju-run -u ceph-osd/2 -- config-get discard: auto block-db- size: 0 block-wal- size: 0 compression- algorithm: lz4 failure- domain: true device- errors: false servicegroups: "" by-dname/ sdb keymanager: ceph
aa-profile-mode: complain
autotune: false
bdev-enable-
bluestore: true
bluestore-
bluestore-
bluestore-
customize-
ignore-
loglevel: 1
max-sectors-kb: 1.048576e+06
nagios_context: juju
nagios_
osd-devices: /dev/disk/
osd-encrypt: false
osd-encrypt-
osd-format: xfs
osd-journal-size: 1024
prefer-ipv6: false
source: cloud:bionic-rocky
# Unfortunately, the timestamp gets updated as hook executions pass so we don't have the original one anymore. /var/lib/ juju/agents/ unit-ceph- osd-2/charm# stat .juju-persisten t-config t-config
root@obayifo:
File: .juju-persisten
Size: 1392 Blocks: 8 IO Block: 4096 regular file
Device: 804h/2052d Inode: 23072467 Links: 1
Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2021-04-09 14:59:40.833800139 +0000
Modify: 2021-04-09 14:57:45.776090185 +0000
Change: 2021-04-09 14:57:45.776090185 +0000
Birth: -
root@obayifo: /var/lib/ juju/agents/ unit-ceph- osd-2/charm# cat .juju-persisten t-config zone": null, "bdev-enable- discard" : "auto", "bluestore": true, "bluestore- block-db- size": 0, "bluestore- block-wal- size": 0, "bluestore- compression- algorithm" : "lz4", "bluestore- compression- max-blob- size": null, "bluestore- compression- max-blob- size-hdd" : null, "bluestore- compression- max-blob- size-ssd" : null, "bluestore- compression- min-blob- size": null, "bluestore- compression- min-blob- size-hdd" : null, "bluestore- compression- min-blob- size-ssd" : null, "bluestore- compression- mode": null, "bluestore- compression- required- ratio": null, "bluestore-db": null, "bluestore-wal": null, "ceph-cluster- network" : null, "ceph-public- network" : null, "config-flags": null, "crush- initial- weight" : null, "customize- failure- domain" : true, "ephemeral- unmount" : null, "harden": null, "ignore- device- errors" : false, "key": null, "loglevel": 1, "max-sectors-kb": 1048576, "nagios_context": "juju", "nagios_ servicegroups" : "", "osd-devices": "/dev/disk/ by-dname/ sdb", "osd-encrypt": false, "osd-encrypt- keymanager" : "ceph", "osd-format": "xfs", "osd-journal": null, "osd-journal-size": 1024, "osd-max- backfills" : null, "osd-recovery- max-active" : null, "prefer-ipv6": false, "source": "cloud: bionic- rocky", "sysctl": "{ kernel.pid_max : 2097152, vm.max_map_count : 524288, kernel.threads-max: 2097152 }", "use-direct-io": true, "use-syslog": false}
{"aa-profile-mode": "complain", "autotune": false, "availability_
juju show-status-log ceph-osd/2 changed hook for ceph-mon/1 settings- changed hook
Time Type Status Message
07 Apr 2021 21:00:55Z juju-unit idle
07 Apr 2021 21:01:28Z juju-unit executing running mon-relation-
07 Apr 2021 21:01:47Z juju-unit idle
08 Apr 2021 12:08:56Z juju-unit executing running leader-
08 Apr 2021 12:08:56Z juju-unit idle
09 Apr 2021 12:47:28Z juju-unit executing running config-changed hook
09 Apr 2021 12:47:37Z juju-unit idle