]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common, osd: Apply randomly selected scheduler type across all OSD shards
authorSridhar Seshasayee <sseshasa@redhat.com>
Fri, 15 Sep 2023 13:54:08 +0000 (19:24 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 13 Nov 2023 18:55:14 +0000 (00:25 +0530)
commit96df279132473f459c692787609702542a32231f
treefd57f3da397286f12489655683c72b4db12264dc
parent28a26f7b0441649deef0692e48d4cbe2d95e2cfe
common, osd: Apply randomly selected scheduler type across all OSD shards

Originally, the choice of 'debug_random' for osd_op_queue resulted in the
selection of a random scheduler type for each OSD shard. A more realistic
scenario for testing would be the selection of the random scheduler type
applied globally for all shards of an OSD. In other words, all OSD shards
would employ the same scheduler type. For e.g., this scenario would be
possible during upgrades when the scheduler type has changed between
releases.

The following changes are made as part of the commit:
 1. Introduce enum class op_queue_type_t within osd_types.h that holds the
    various op queue types supported. This header in included by OpQueue.h.
    Add helper functions osd_types.cc to return the op_queue_type_t as
    enum or a string representing the enum member.
 2. Determine the scheduler type before initializing the OSD shards in
    OSD class constructor.
 3. Pass the determined op_queue_type_t to the OSDShard's make_scheduler()
    method for each shard. This ensures all shards of the OSD are
    initialized with the same scheduler type.
 4. Rename & modify the unused OSDShard::get_scheduler_type() method to
    return op_queue_type_t set for the queue.
 5. Introduce OpScheduler::get_type() and OpQueue::get_type() pure
    virtual functions and define them within the respective queue
    implementation. This returns a value pertaining to the op queue type.
    This is called by OSDShard::get_op_queue_type().
 6. Add OSD::osd_op_queue_type() method for determining the scheduler
    type set on the OSD shards. Since all OSD shards are set to use
    the same scheduler type, the shard with the lowest id is used to
    get the scheduler type using OSDShard::get_op_queue_type().
 7. Improve comment description related to 'osd_op_queue' option in
    common/options/osd.yaml.in.

Call Flow
--------
OSD                     OSDShard                 OpScheduler/OpQueue
---                     --------                 -------------------
osd_op_queue_type() ->
                        get_op_queue_type() ->
                                                 get_type()

Fixes: https://tracker.ceph.com/issues/62171
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
src/common/OpQueue.h
src/common/PrioritizedQueue.h
src/common/WeightedPriorityQueue.h
src/common/options/osd.yaml.in
src/osd/OSD.cc
src/osd/OSD.h
src/osd/osd_types.cc
src/osd/osd_types.h
src/osd/scheduler/OpScheduler.cc
src/osd/scheduler/OpScheduler.h
src/osd/scheduler/mClockScheduler.h