]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/cephadm: fix reweighting of OSD when OSD removal is stopped
authorAdam King <adking@redhat.com>
Tue, 7 Nov 2023 20:49:57 +0000 (15:49 -0500)
committerAdam King <adking@redhat.com>
Tue, 7 Nov 2023 20:58:35 +0000 (15:58 -0500)
commit99fc4a8d406291b65a53f157442bc54bc67e8b0d
tree883937769d2b355cd4a1e2b27e59e74c6025104a
parent5eca12b0543f4c8cb331edc40806c7e6c688e831
mgr/cephadm: fix reweighting of OSD when OSD removal is stopped

Previously, when you ran "ceph orch osd rm stop <osd-id>"
cephadm would pass in a new OSD object to the removal
queue that would not have any of the fields set previously
for the OSD. This was mostly fine when removing it from
the queue as those fields were no longer needed, but an
exception was the initial weight, which you need if
you want to set the weight back when you stop removal.

This patch changes it so it will now remove the actual
OSD object the removal queue stores so that we will
get to use the previously set original weight. It also
changes when we grab the original weight to make it
happen earlier and adds it to the to_json so it survives
any potential mgr failovers.

Fixes: https://tracker.ceph.com/issues/63481
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/services/osd.py
src/pybind/mgr/cephadm/tests/test_cephadm.py