CephContext *cct;
std::string key;
std::string val;
- bool update_shard;
public:
explicit MonCmdSetConfigOnFinish(
OSD *o,
CephContext *cct,
const std::string &k,
- const std::string &v,
- const bool s)
- : osd(o), cct(cct), key(k), val(v), update_shard(s) {}
+ const std::string &v) : osd(o), cct(cct), key(k), val(v) {}
void finish(int r) override {
if (r != 0) {
// Fallback to setting the config within the in-memory "values" map.
cct->_conf.set_val_default(key, val);
}
-
- // If requested, apply this option on the
- // active scheduler of each op shard.
- if (update_shard) {
- for (auto& shard : osd->shards) {
- shard->update_scheduler_config();
- }
- }
+ cct->_conf.apply_changes(nullptr);
}
};
"}";
vector<std::string> vcmd{cmd};
- // List of config options to be distributed across each op shard.
- // Currently limited to a couple of mClock options.
- static const std::vector<std::string> shard_option =
- { "osd_mclock_max_capacity_iops_hdd", "osd_mclock_max_capacity_iops_ssd" };
- const bool update_shard = std::find(shard_option.begin(),
- shard_option.end(),
- key) != shard_option.end();
-
- auto on_finish = new MonCmdSetConfigOnFinish(this, cct, key,
- val, update_shard);
+ auto on_finish = new MonCmdSetConfigOnFinish(this, cct, key, val);
dout(10) << __func__ << " Set " << key << " = " << val << dendl;
monc->start_mon_command(vcmd, {}, nullptr, nullptr, on_finish);
}
}
}
-void OSDShard::update_scheduler_config()
-{
- scheduler->update_configuration();
-}
-
op_queue_type_t OSDShard::get_op_queue_type() const
{
return scheduler->get_type();
// Print human readable brief description with relevant parameters
virtual void print(std::ostream &out) const = 0;
- // Apply config changes to the scheduler (if any)
- virtual void update_configuration() = 0;
-
// Get the scheduler type set for the queue
virtual op_queue_type_t get_type() const = 0;
out << ", cutoff=" << cutoff << ")";
}
- void update_configuration() final {
- // no-op
- }
-
op_queue_type_t get_type() const final {
return queue.get_type();
}
return mclock_conf.calc_scaled_cost(item_cost);
}
-void mClockScheduler::update_configuration()
-{
- // Apply configuration change. The expectation is that
- // at least one of the tracked mclock config option keys
- // is modified before calling this method.
- cct->_conf.apply_changes(nullptr);
-}
-
void mClockScheduler::dump(ceph::Formatter &f) const
{
// Display queue sizes