.set_default(60)
.set_min(0)
.set_description("RBD Image access timestamp refresh interval. Set to 0 to disable access timestamp update."),
+
+ Option("rbd_config_pool_override_update_timestamp", Option::TYPE_UINT,
+ Option::LEVEL_DEV)
+ .set_default(0)
+ .set_description("timestamp of last update to pool-level config overrides"),
+
});
}
"rbd_tracing",
"rbd_validate_names",
"rbd_validate_pool",
- "rbd_mirror_pool_replayers_refresh_interval"
+ "rbd_mirror_pool_replayers_refresh_interval",
+ "rbd_config_pool_override_update_timestamp"
};
static std::set<std::string> EXCLUDE_IMAGE_OPTIONS {
"rbd_default_clone_format",
const std::string &value) {
CephContext *cct = (CephContext *)io_ctx.cct();
+ bool update_pool_timestamp = false;
+
std::string config_key;
if (util::is_metadata_config_override(key, &config_key)) {
if (!librbd::api::Config<I>::is_option_name(io_ctx, config_key)) {
<< dendl;
return -EINVAL;
}
+
+ update_pool_timestamp = true;
}
ceph::bufferlist bl;
return r;
}
+ if (update_pool_timestamp) {
+ auto now = ceph_clock_now();
+ std::string cmd =
+ R"({)"
+ R"("prefix": "config set", )"
+ R"("who": "global", )"
+ R"("name": "rbd_config_pool_override_update_timestamp", )"
+ R"("value": ")" + stringify(now.sec()) + R"(")"
+ R"(})";
+
+ librados::Rados rados(io_ctx);
+ bufferlist in_bl;
+ std::string ss;
+ r = rados.mon_command(cmd, in_bl, nullptr, &ss);
+ if (r < 0) {
+ lderr(cct) << "failed to notify clients of pool config update: "
+ << cpp_strerror(r) << dendl;
+ }
+ }
+
return 0;
}