]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: fix reweighting of OSD when OSD removal is stopped 56083/head
authorAdam King <adking@redhat.com>
Tue, 7 Nov 2023 20:49:57 +0000 (15:49 -0500)
committerAdam King <adking@redhat.com>
Sun, 10 Mar 2024 19:07:13 +0000 (15:07 -0400)
commitec7934bb42fa17754249147474c18d7dfdf23f5b
tree1456db8d5b175b6b280593468ca5c174448b2cc8
parent5bee1087985ebe9d721cdeeb2ee8183e5cf42d59
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>
(cherry picked from commit 99fc4a8d406291b65a53f157442bc54bc67e8b0d)
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/services/osd.py
src/pybind/mgr/cephadm/tests/test_cephadm.py