]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add missing last_modified field to swift api
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, 23 Dec 2024 14:38:36 +0000 (15:38 +0100)
Fixes: https://tracker.ceph.com/issues/68195
Signed-off-by: Andrei Ivashchenko <aiivashchenko@users.noreply.github.com>
src/rgw/rgw_common.h
src/rgw/rgw_rest_swift.cc
src/rgw/services/svc_bucket_sobj.cc

index 8dafe14750919a82c6387bfa963184e7c1cdc468..d7b0819d35636361dc46ef02e6da24d077b69512 100644 (file)
@@ -1426,6 +1426,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 b8ff3ca2fe8c06aff4d49f378b783931025c1a0c..88af0fc9c273600b36553223bb20579404e37231 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 ca705c5a44d02a5ec13e63d3c54c28923eb5cf04..0f4cd4e847b5ae8cd999ad4618362209b75cab37 100644 (file)
@@ -556,7 +556,7 @@ int RGWSI_Bucket_SObj::read_bucket_stats(const rgw_bucket& bucket,
                                          const DoutPrefixProvider *dpp)
 {
   RGWBucketInfo bucket_info;
-  int ret = read_bucket_info(bucket, &bucket_info, nullptr, nullptr, boost::none, y, dpp);
+  int ret = read_bucket_info(bucket, &bucket_info, &ent->modification_time, nullptr, boost::none, y, dpp);
   if (ret < 0) {
     return ret;
   }