"of RGW instances under heavy use. If you would like "
"to turn off cache expiry, set this value to zero."),
+
+ Option("rgw_inject_notify_timeout_probability", Option::TYPE_FLOAT,
+ Option::LEVEL_DEV)
+ .set_default(0)
+ .add_tag("fault injection")
+ .add_tag("testing")
+ .add_service("rgw")
+ .set_min_max(0.0, 1.0)
+ .set_description("Likelihood of ignoring a notify")
+ .set_long_description("This is the probability that the RGW cache will "
+ "ignore a cache notify message. It exists to help "
+ "with the development and testing of cache "
+ "consistency and recovery improvements. Please "
+ "do not set it in a production cluster, as it "
+ "actively causes failures. Set this to a floating "
+ "point value between 0 and 1."),
});
}
<< " cookie " << cookie
<< " notifier " << notifier_id
<< " bl.length()=" << bl.length() << dendl;
+
+ if (unlikely(rados->inject_notify_timeout_probability == 1) ||
+ (rados->inject_notify_timeout_probability > 0 &&
+ (rados->inject_notify_timeout_probability >
+ ceph::util::generate_random_number(0.0, 1.0)))) {
+ ldout(rados->ctx(), 0)
+ << "RGWWatcher::handle_notify() dropping notification! "
+ << "If this isn't what you want, set "
+ << "rgw_inject_notify_timeout_probability to zero!" << dendl;
+ return;
+ }
+
+
+
rados->watch_cb(notify_id, cookie, notifier_id, bl);
bufferlist reply_bl; // empty reply payload
{
int ret;
+ inject_notify_timeout_probability =
+ cct->_conf.get_val<double>("rgw_inject_notify_timeout_probability");
+
ret = init_rados();
if (ret < 0)
return ret;
librados::IoCtx control_pool_ctx; // .rgw.control
bool watch_initialized;
+ double inject_notify_timeout_probability = 0;
+
friend class RGWWatcher;
Mutex bucket_id_lock;