]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: disable RGWDataChangesLog::add_entry() when log_data is off
authorCasey Bodley <cbodley@redhat.com>
Fri, 11 Mar 2022 00:03:59 +0000 (19:03 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 24 May 2023 18:49:32 +0000 (14:49 -0400)
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/61300
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_datalog.cc

index 7ca37abf684846318b8920a671c1f6a535b86db6..2bd4669ab56a01b267c12d54baeff4d16456511d 100644 (file)
@@ -640,6 +640,10 @@ int RGWDataChangesLog::add_entry(const DoutPrefixProvider *dpp,
                                 const rgw::bucket_log_layout_generation& gen,
                                 int shard_id, optional_yield y)
 {
+  if (!zone->log_data) {
+    return 0;
+  }
+
   auto& bucket = bucket_info.bucket;
 
   if (!filter_bucket(dpp, bucket, y)) {