]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: ignore sync init state when doing bilog trimming
authorYuval Lifshitz <ylifshit@redhat.com>
Fri, 15 Apr 2022 11:45:49 +0000 (14:45 +0300)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:34 +0000 (15:47 -0400)
regardless of the sync state, we take the marker from the
incremental sync object

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_trim_bilog.cc

index 606e90670c8ed5fe5bedb533dbe0d80ea2401804..ffeea0d0fc31f4834aaec8d05ce6efe889a52436 100644 (file)
@@ -6198,7 +6198,8 @@ int RGWRados::Bucket::UpdateIndex::guard_reshard(const DoutPrefixProvider *dpp,
       obj_instance.key << dendl;
     r = store->block_while_resharding(bs, obj_instance, target->bucket_info, null_yield, dpp);
     if (r == -ERR_BUSY_RESHARDING) {
-      ldpp_dout(dpp, 0) << "ERROR: block_while_resharding() still busy. obj=" << dendl;
+      ldpp_dout(dpp, 0) << "ERROR: block_while_resharding() still busy. obj=" <<
+        obj_instance.key << dendl;
       continue;
     }
     if (r < 0) {
index c44ae0c03a0f229eee37b86693542be267e1dbd1..ec657773e76bd90d64f0a82cf877b04b00b62047 100644 (file)
@@ -559,6 +559,10 @@ int take_min_status(
   std::vector<BucketTrimInstanceCR::StatusShards>::const_iterator last,
   std::vector<std::string> *status) {
   for (auto peer = first; peer != last; ++peer) {
+    // Peers on later generations don't get a say in the matter
+    if (peer->generation > min_generation) {
+      continue;
+    }
     if (peer->shards.size() != status->size()) {
       // all peers must agree on the number of shards
       return -EINVAL;
@@ -567,14 +571,6 @@ int take_min_status(
     auto m = status->begin();
     for (auto& shard : peer->shards) {
       auto& marker = *m++;
-      // Peers on later generations don't get a say in the matter
-      if (peer->generation > min_generation) {
-       continue;
-      }
-      // if no sync has started, we can safely trim everything
-      if (shard.state == rgw_bucket_shard_sync_info::StateInit) {
-       continue;
-      }
       // always take the first marker, or any later marker that's smaller
       if (peer == first || marker > shard.inc_marker.position) {
        marker = std::move(shard.inc_marker.position);