]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: Fix race between host_add and _apply_all_specs
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 14 Sep 2020 10:17:43 +0000 (12:17 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 6 Oct 2020 09:40:53 +0000 (11:40 +0200)
commitb67ec0ada52cbeccb2939db479796b4bc76e7fd3
tree854ad60a18f11879c78c49aa8a1b96736823eb19
parentdb395516200d2068e3e1577706e22e454ecd5a13
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>
(cherry picked from commit 72e3990382d65205de7871cc86b5063ed16732e5)
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