]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: disable RGWDataChangesLog::add_entry() when log_data is off 45357/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 11 Mar 2022 00:03:59 +0000 (19:03 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 11 Mar 2022 14:20:21 +0000 (09:20 -0500)
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.<bucketname>` and
`bucket.sync-target-hints.<bucketname>`

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 <cbodley@redhat.com>
src/rgw/rgw_datalog.cc

index b52e52000774420de465eaef75eedb76fc861f1e..7b4cd29afb8b582b811d65ebdc59165b18dc25c6 100644 (file)
@@ -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)) {