From: Yuval Lifshitz Date: Fri, 15 Apr 2022 11:45:49 +0000 (+0300) Subject: rgw/multisite: ignore sync init state when doing bilog trimming X-Git-Tag: v18.0.0~787^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=061836ea77ee86338655fe5dff35d8b0bcb37896;p=ceph.git rgw/multisite: ignore sync init state when doing bilog trimming regardless of the sync state, we take the marker from the incremental sync object Signed-off-by: Yuval Lifshitz --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 606e90670c8e..ffeea0d0fc31 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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) { diff --git a/src/rgw/rgw_trim_bilog.cc b/src/rgw/rgw_trim_bilog.cc index c44ae0c03a0f..ec657773e76b 100644 --- a/src/rgw/rgw_trim_bilog.cc +++ b/src/rgw/rgw_trim_bilog.cc @@ -559,6 +559,10 @@ int take_min_status( std::vector::const_iterator last, std::vector *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);