From bf0a4ef1aa50a66bbb45ed7b2f7a5ce08d1fbecc Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 10 Mar 2021 16:12:13 -0500 Subject: [PATCH] rgw: allow rgw_data_notify_interval_msec=0 to disable notifications the data changes log for multisite will occasionally broadcast recent changes to other zones, which they can use to prioritize sync of some of the most recent changes. they'll eventually see all changes as they replay the data changes log, though, so notifications aren't required for successful sync. the ability to turn them off is useful for testing Fixes: https://tracker.ceph.com/issues/49723 Signed-off-by: Casey Bodley --- src/common/options/rgw.yaml.in | 6 +++++- src/rgw/rgw_datalog.cc | 4 ++++ src/rgw/rgw_rados.cc | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 079609acb591f..ac7f6ac1b6e60 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -2801,9 +2801,13 @@ options: type: int level: advanced desc: data changes notification interval to followers + long_desc: In multisite, radosgw will occasionally broadcast new entries in its + data changes log to peer zones, so they can prioritize sync of some + of the most recent changes. Can be disabled with 0. default: 200 services: - rgw + with_legacy: true - name: rgw_torrent_origin type: str level: advanced @@ -2822,7 +2826,7 @@ options: type: bool level: basic desc: Enable dynamic resharding - long_desc: If true, RGW will dynamicall increase the number of shards in buckets + long_desc: If true, RGW will dynamically increase the number of shards in buckets that have a high number of objects per shard. default: true services: diff --git a/src/rgw/rgw_datalog.cc b/src/rgw/rgw_datalog.cc index 24acd3624edab..c64969712ae25 100644 --- a/src/rgw/rgw_datalog.cc +++ b/src/rgw/rgw_datalog.cc @@ -990,6 +990,10 @@ void RGWDataChangesLog::renew_stop() void RGWDataChangesLog::mark_modified(int shard_id, const rgw_bucket_shard& bs) { + if (!cct->_conf->rgw_data_notify_interval_msec) { + return; + } + auto key = bs.get_key(); { std::shared_lock rl{modified_lock}; // read lock to check for existence diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e4fa7afcb112a..680da9f4fc433 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1311,8 +1311,10 @@ int RGWRados::init_complete(const DoutPrefixProvider *dpp) sync_log_trimmer->start(); } } - data_notifier = new RGWDataNotifier(this); - data_notifier->start(); + if (cct->_conf->rgw_data_notify_interval_msec) { + data_notifier = new RGWDataNotifier(this); + data_notifier->start(); + } binfo_cache = new RGWChainedCacheImpl; binfo_cache->init(svc.cache); -- 2.39.5