]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix dynamic reshard happening during user stats sync 44536/head
authorYuval Lifshitz <ylifshit@redhat.com>
Mon, 10 Jan 2022 16:55:50 +0000 (18:55 +0200)
committerYuval Lifshitz <ylifshit@redhat.com>
Tue, 11 Jan 2022 18:38:26 +0000 (20:38 +0200)
this is a regression caused by the following commit:
https://github.com/ceph/ceph/commit/72d1a363263cf707d022ee756122236ba175cda2

to verify use the following instructions:
https://gist.github.com/yuvalif/d526c0a3a4c5b245b9e951a6c5a10517

Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_bucket.h
src/rgw/rgw_sal_rados.cc
src/rgw/services/svc_bi_rados.cc

index a2797b47d0c22da360a7cce402827669ecded673..0bc24db7e40957c8571800b32fa62d38e031c72e 100644 (file)
@@ -705,7 +705,7 @@ public:
   int sync_user_stats(const DoutPrefixProvider *dpp, 
                       const rgw_user& user_id, const RGWBucketInfo& bucket_info,
                      optional_yield y,
-                      RGWBucketEnt* pent = nullptr);
+                      RGWBucketEnt* pent);
 
   /* bucket sync */
   int get_sync_policy_handler(std::optional<rgw_zone_id> zone,
index d0ba542c990112961856753e652d1b31d0b38b56..97f64a0acbf64105a1f54ad72ab8e2b624310a77 100644 (file)
@@ -403,7 +403,7 @@ int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp,
   (void) store->getRados()->get_lc()->remove_bucket_config(
     this, get_attrs());
 
-  ret = store->ctl()->bucket->sync_user_stats(dpp, info.owner, info, y);
+  ret = store->ctl()->bucket->sync_user_stats(dpp, info.owner, info, y, nullptr);
   if (ret < 0) {
      ldout(store->ctx(), 1) << "WARNING: failed sync user stats before bucket delete. ret=" <<  ret << dendl;
   }
@@ -627,7 +627,7 @@ int RadosBucket::read_stats_async(const DoutPrefixProvider *dpp, int shard_id, R
 
 int RadosBucket::sync_user_stats(const DoutPrefixProvider *dpp, optional_yield y)
 {
-  return store->ctl()->bucket->sync_user_stats(dpp, owner->get_id(), info, y);
+  return store->ctl()->bucket->sync_user_stats(dpp, owner->get_id(), info, y, &ent);
 }
 
 int RadosBucket::update_container_stats(const DoutPrefixProvider* dpp)
index 950ded02f6345162eb6e10a16078a2240b5ceac2..10d7720875f05b8e0ebd95ef52df98e8cde1ae2f 100644 (file)
@@ -382,6 +382,10 @@ int RGWSI_BucketIndex_RADOS::read_stats(const DoutPrefixProvider *dpp,
     return r;
   }
 
+  result->count = 0; 
+  result->size = 0; 
+  result->size_rounded = 0; 
+
   auto hiter = headers.begin();
   for (; hiter != headers.end(); ++hiter) {
     RGWObjCategory category = RGWObjCategory::Main;