]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add missing last_modified field to swift api 61546/head
authorAndrei Ivashchenko <aiivashchenko@users.noreply.github.com>
Fri, 20 Dec 2024 14:09:50 +0000 (15:09 +0100)
committerAndrei Ivashchenko <aiivashchenko@users.noreply.github.com>
Mon, 27 Jan 2025 16:11:19 +0000 (17:11 +0100)
Fixes: https://tracker.ceph.com/issues/68195
Signed-off-by: Andrei Ivashchenko <aiivashchenko@users.noreply.github.com>
(cherry picked from commit 24984b704f0482bfbe09dc82d373fe40cc897c29)

Conflicts:
src/rgw/services/svc_bucket_sobj.cc
read_bucket_info signature in squid has ctx agrument, while upstream hasn't

src/rgw/rgw_common.h
src/rgw/rgw_rest_swift.cc
src/rgw/services/svc_bucket_sobj.cc

index 2002ae51ec9b9ab12bde7f3a5c2452730e528ed5..68a726e49059b701864d2ebe2236dc103220e636 100644 (file)
@@ -1412,6 +1412,7 @@ struct RGWBucketEnt {
   size_t size;
   size_t size_rounded;
   ceph::real_time creation_time;
+  ceph::real_time modification_time;
   uint64_t count;
 
   /* The placement_rule is necessary to calculate per-storage-policy statics
index bde5925dfd1a91759fef5db470d66b13e2235b9c..a67b1b483a4bd308919c5b1755b7b4c75099393e 100644 (file)
@@ -361,6 +361,7 @@ void RGWListBuckets_ObjStore_SWIFT::dump_bucket_entry(const RGWBucketEnt& ent)
   if (need_stats) {
     s->formatter->dump_int("count", ent.count);
     s->formatter->dump_int("bytes", ent.size);
+    dump_time(s, "last_modified", ent.modification_time);
   }
 
   s->formatter->close_section();
index 41e7b02e17596610351157bb69b71d1aec3b8d5b..bc99f0a034acca6ed0eb7c79b1db291b1aee7f74 100644 (file)
@@ -617,7 +617,7 @@ int RGWSI_Bucket_SObj::read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
                                          const DoutPrefixProvider *dpp)
 {
   RGWBucketInfo bucket_info;
-  int ret = read_bucket_info(ctx, bucket, &bucket_info, nullptr, nullptr, boost::none, y, dpp);
+  int ret = read_bucket_info(ctx, bucket, &bucket_info, &ent->modification_time, nullptr, boost::none, y, dpp);
   if (ret < 0) {
     return ret;
   }