using Config = crimson::common::ConfigProxy;
const std::string test_uint_option = "osd_max_pgls";
const uint64_t INVALID_VALUE = (uint64_t)(-1);
+const uint64_t EXPECTED_VALUE = 42;
class ConfigObs : public ceph::md_config_obs_impl<Config> {
uint64_t last_change = INVALID_VALUE;
}).then([] {
return sharded_cobs.start();
}).then([] {
- return crimson::common::sharded_conf().invoke_on_all([](Config& config) {
- return config.set_val(test_uint_option,
- std::to_string(seastar::this_shard_id()));
- });
+ auto& conf = crimson::common::local_conf();
+ return conf.set_val(test_uint_option, std::to_string(EXPECTED_VALUE));
}).then([] {
- auto expected = crimson::common::local_conf().get_val<uint64_t>(test_uint_option);
- return crimson::common::sharded_conf().invoke_on_all([expected](Config& config) {
- if (expected != config.get_val<uint64_t>(test_uint_option)) {
+ return crimson::common::sharded_conf().invoke_on_all([](Config& config) {
+ if (config.get_val<uint64_t>(test_uint_option) != EXPECTED_VALUE) {
throw std::runtime_error("configurations don't match");
}
- if (expected != sharded_cobs.local().get_last_change()) {
+ if (sharded_cobs.local().get_last_change() != EXPECTED_VALUE) {
throw std::runtime_error("last applied changes don't match the latest config");
}
- if (seastar::smp::count != sharded_cobs.local().get_num_changes()) {
+ if (sharded_cobs.local().get_num_changes() != 1) {
throw std::runtime_error("num changes don't match actual changes");
}
});