From: Matt Benjamin Date: Fri, 18 Feb 2022 17:23:30 +0000 (-0500) Subject: rgwlc: include lc shard oid in "lc shard list" X-Git-Tag: v18.0.0~1240^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc0127ee1299393068517dbe528eb864ba01d379;p=ceph.git rgwlc: include lc shard oid in "lc shard list" 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 --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 3ea1119e0ff80..4a8ddb13c923c 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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( diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 2fc8ab62b9bb7..a04e200973af3 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -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; diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 8c9f9ef031b7d..f84a5abec5398 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -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;