]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: on bucket reshard, write datalog entries for each shard of the previous generation
authorShilpa Jagannath <smanjara@redhat.com>
Fri, 21 May 2021 06:47:49 +0000 (12:17 +0530)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:32 +0000 (15:47 -0400)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/rgw_reshard.cc

index 89f80e119eb4b1364e6851518521d11d79a9addc..672b4b9c8e2c15b425c25e68e9dfc88c53cff185 100644 (file)
@@ -495,6 +495,17 @@ static int commit_reshard(rgw::sal::RadosStore* store,
     return ret;
   }
 
+  if (store->svc()->zone->need_to_log_data()) {
+    for (uint32_t shard_id = 0; shard_id < prev.current_index.layout.normal.num_shards; ++shard_id) {
+      ret = store->svc()->datalog_rados->add_entry(dpp, bucket_info, prev.logs.back(), shard_id);
+      if (ret < 0) {
+        ldpp_dout(dpp, 1) << "WARNING: failed writing data log (bucket_info.bucket="
+        << bucket_info.bucket << ", shard_id=" << shard_id << "of generation="
+        << prev.logs.back().gen << ")" << dendl;
+        }
+      }
+  }
+
   // on success, delete index shard objects from the old layout (ignore errors)
   if (remove_index) {
     store->svc()->bi->clean_index(dpp, bucket_info, prev.current_index);