]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: Restore defaults of mClock built-in profiles upon modification
authorSridhar Seshasayee <sseshasa@redhat.com>
Thu, 27 Oct 2022 05:02:46 +0000 (10:32 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 9 Jan 2023 14:24:44 +0000 (19:54 +0530)
commitb12780667f7b038f615d198c225f761ad7191ea9
treeb55d932074e5c711607a27ecd138866ad0bd0e81
parent1650525670741fea1b27d2b1c00e4aecd70555d4
osd: Restore defaults of mClock built-in profiles upon modification

The QoS parameters (res, wgt, lim) of mClock profiles are not allowed to
be modified by users using commands like "config set" or via admin socket.
handle_conf_change() does not allow changes to any built-in mClock profile
at the mClock scheduler. But the config subsystem showed the change as
expected for the built-in mClock profile QoS parameters. This misled the
user into thinking that the change was made at the mClock server when
it was not the case.

The above issue is the result of the config "levels" used by the config
subsystem. The inital built-in QoS params are set at the CONF_DEFAULT
level. This allows the user to modify the built-in QoS params using
"config set" command which sets values at CONF_MON level which has higher
priority than CONF_DEFAULT level. The new value is persisted on the mon
store and therefore the config subsystem shows the change when "config
show" command is issued.

To prevent the above, this commit adds changes to restore the defaults set
for the built-in profiles by removing the new config changes from the MON
store. This results in the original defaults to come back into effect and
maintain a consistent view of the built-in profile across all levels.

To accomplish this, the mClock scheduler is provided with additional
information like the OSD id, shard id and a pointer to the MonClient
using which the Mon store command to remove the option is executed.

A standalone test is added to verify that built-in params cannot be
modified and the original profile params are retained.

Fixes: https://tracker.ceph.com/issues/57533
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
qa/standalone/misc/mclock-config.sh
src/osd/OSD.cc
src/osd/scheduler/OpScheduler.cc
src/osd/scheduler/OpScheduler.h
src/osd/scheduler/mClockScheduler.cc
src/osd/scheduler/mClockScheduler.h
src/test/osd/TestMClockScheduler.cc