From: Casey Bodley Date: Fri, 11 Mar 2022 00:03:59 +0000 (-0500) Subject: rgw: disable RGWDataChangesLog::add_entry() when log_data is off X-Git-Tag: v17.2.8~116^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F59314%2Fhead;p=ceph.git rgw: disable RGWDataChangesLog::add_entry() when log_data is off this restores a check for RGWZone::log_data in add_entry(). with per-bucket replication, this check was replaced by a call to `RGWBucketSyncPolicyHandler::bucket_exports_data()` this call has to consult two rados objects, `bucket.sync-source-hints.` and `bucket.sync-target-hints.` but if the zone is not configured for multisite, we should avoid these extra object reads and return early Fixes: https://tracker.ceph.com/issues/54531 Signed-off-by: Casey Bodley (cherry picked from commit 6eec5e35a4f3c8c7e9783e3706e893cabef5993f) --- diff --git a/src/rgw/rgw_datalog.cc b/src/rgw/rgw_datalog.cc index b52e52000774..7b4cd29afb8b 100644 --- a/src/rgw/rgw_datalog.cc +++ b/src/rgw/rgw_datalog.cc @@ -603,6 +603,10 @@ std::string RGWDataChangesLog::get_oid(uint64_t gen_id, int i) const { } int RGWDataChangesLog::add_entry(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id) { + if (!zone->log_data) { + return 0; + } + auto& bucket = bucket_info.bucket; if (!filter_bucket(dpp, bucket, null_yield)) {