]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: include lc shard oid in "lc shard list"
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 18 Feb 2022 17:23:30 +0000 (12:23 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 17 Mar 2022 15:07:55 +0000 (11:07 -0400)
E.g.,
[
    {
        "bucket": ":bucket1:f2f4a8dd-7ec9-4758-bc4f-c8f5fbc85109.4137.2",
        "shard": "lc.6",
        "started": "Fri, 18 Feb 2022 17:30:16 GMT",
        "status": "COMPLETE"
    },
...
]

The prototyped approach adds a copy of the shard name (which is
assured to be a small string) to rgw::sal::LCEntry.  It's not
expected to be represented in underlying store types.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_sal.h
src/rgw/rgw_sal_rados.cc

index 3ea1119e0ff807b18db40b1384d47384266e7810..4a8ddb13c923c42a42065cebf1d21484617d894d 100644 (file)
@@ -7879,6 +7879,7 @@ next:
       for (const auto& entry : bucket_lc_map) {
         formatter->open_object_section("bucket_lc_info");
         formatter->dump_string("bucket", entry.bucket);
+       formatter->dump_string("shard", entry.oid);
        char exp_buf[100];
        time_t t{time_t(entry.start_time)};
        if (std::strftime(
index 2fc8ab62b9bb7d3ebbaa1d84359be7417f0d668c..a04e200973af32c3c50248ed696831eb4499e341 100644 (file)
@@ -1295,11 +1295,13 @@ public:
    * buckets. */
   struct LCEntry {
     std::string bucket;
+    std::string oid;
     uint64_t start_time{0};
     uint32_t status{0};
 
     LCEntry() = default;
     LCEntry(std::string& _bucket, uint64_t _time, uint32_t _status) : bucket(_bucket), start_time(_time), status(_status) {}
+    LCEntry(std::string& _bucket, std::string _oid, uint64_t _time, uint32_t _status) : bucket(_bucket), oid(_oid), start_time(_time), status(_status) {}
   };
 
   Lifecycle() = default;
index 8c9f9ef031b7da6dc24178d7f3b3e4a215593efa..f84a5abec5398a601ba50f025f4479653c937185 100644 (file)
@@ -2537,7 +2537,8 @@ int RadosLifecycle::list_entries(const std::string& oid, const std::string& mark
     return ret;
 
   for (auto& entry : cls_entries) {
-    entries.push_back(LCEntry(entry.bucket, entry.start_time, entry.status));
+    entries.push_back(LCEntry(entry.bucket, oid, entry.start_time,
+                             entry.status));
   }
 
   return ret;