]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: Fix race between host_add and _apply_all_specs 37135/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 14 Sep 2020 10:17:43 +0000 (12:17 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Mon, 14 Sep 2020 10:17:43 +0000 (12:17 +0200)
commit72e3990382d65205de7871cc86b5063ed16732e5
tree7385c9927eacd1b06820fa2ad802f913dca589b2
parent7b7aeafad1bb4e3f0818417008f5df616de8f90c
mgr/cephadm: Fix race between host_add and _apply_all_specs

This mitigates a potential race, where new host was added *after*
``_refresh_host_daemons()`` was called, but *before*
``_apply_all_specs()`` was called. thus we end up with a hosts
where daemons might be running, but we have not yet detected them.

Imagine:

1. the initial MGR was deployed manually
2. `serve()` is called
3. `_refresh_hosts_and_daemons()` is called
4. `add_host()` is called with the initial host
5. `apply_all_specs()` now deploys an additional MGR on the initial host

Fixes: https://tracker.ceph.com/issues/45093
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/tests/fixtures.py
src/pybind/mgr/cephadm/tests/test_cephadm.py
src/pybind/mgr/cephadm/tests/test_migration.py