]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/reshard: Add logrecord phase in resharding
authorliangmingyuan <liangmingyuan@baidu.com>
Wed, 7 Feb 2024 10:37:31 +0000 (18:37 +0800)
committerliangmingyuan <liangmingyuan@baidu.com>
Sat, 20 Jul 2024 14:55:56 +0000 (22:55 +0800)
Define a new status for reshard named IN_LOGRECORD, which will be
used later for recording the index ops written when a bucket is
resharding.

Signed-off-by: Mingyuan Liang <liangmingyuan@baidu.com>
src/cls/rgw/cls_rgw_types.h
src/rgw/driver/rados/rgw_bucket.cc
src/rgw/rgw_common.cc

index 3ef1555873db17943e834d9cda5fe8e958f3bd49..de10671e290b0c65a8f2903cdba6282db939d10f 100644 (file)
@@ -716,8 +716,9 @@ inline bool operator!=(const rgw_bucket_category_stats& lhs,
 
 enum class cls_rgw_reshard_status : uint8_t {
   NOT_RESHARDING  = 0,
-  IN_PROGRESS     = 1,
-  DONE            = 2
+  IN_LOGRECORD    = 1,
+  IN_PROGRESS     = 2,
+  DONE            = 3
 };
 std::ostream& operator<<(std::ostream&, cls_rgw_reshard_status);
 
@@ -726,6 +727,8 @@ inline std::string to_string(const cls_rgw_reshard_status status)
   switch (status) {
   case cls_rgw_reshard_status::NOT_RESHARDING:
     return "not-resharding";
+  case cls_rgw_reshard_status::IN_LOGRECORD:
+    return "in-logrecord";
   case cls_rgw_reshard_status::IN_PROGRESS:
     return "in-progress";
   case cls_rgw_reshard_status::DONE:
@@ -780,6 +783,10 @@ struct cls_rgw_bucket_instance_entry {
     return reshard_status != RESHARD_STATUS::NOT_RESHARDING;
   }
 
+  bool resharding_in_logrecord() const {
+    return reshard_status == RESHARD_STATUS::IN_LOGRECORD;
+  }
+
   bool resharding_in_progress() const {
     return reshard_status == RESHARD_STATUS::IN_PROGRESS;
   }
@@ -848,9 +855,15 @@ struct rgw_bucket_dir_header {
   bool resharding() const {
     return new_instance.resharding();
   }
+
+  bool resharding_in_logrecord() const {
+    return new_instance.resharding_in_logrecord();
+  }
+
   bool resharding_in_progress() const {
     return new_instance.resharding_in_progress();
   }
+
 };
 WRITE_CLASS_ENCODER(rgw_bucket_dir_header)
 
index 996de5f3c4d85ddecc4de1415a4ceea2657a964b..572c24162e778a6bff32fd379c4eac8027222de6 100644 (file)
@@ -1514,6 +1514,7 @@ static int bucket_stats(rgw::sal::Driver* driver,
     }
   }
 
+  formatter->dump_int("read_tracker", bucket_info.objv_tracker.read_version.ver);
   // TODO: bucket CORS
   // TODO: bucket LC
   formatter->close_section();
index 987475bf390242665e226aa02f1fd265a9321356..433c6f4f8fc26de640ccbb2a8a6604aee1ef6160 100644 (file)
@@ -2564,7 +2564,6 @@ void RGWBucketInfo::decode_json(JSONObj *obj) {
   int rs;
   JSONDecoder::decode_json("reshard_status", rs, obj);
   reshard_status = (cls_rgw_reshard_status)rs;
-
   rgw_sync_policy_info sp;
   JSONDecoder::decode_json("sync_policy", sp, obj);
   if (!sp.empty()) {