]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: "radosgw-admin objects expire" always returns ok even if the process 23001/head
authorZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 20 Jun 2018 03:45:45 +0000 (11:45 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 12 Jul 2018 02:45:44 +0000 (22:45 -0400)
fails.

Fixes: http://tracker.ceph.com/issues/24592
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
(cherry picked from commit f6fe07e8f549f6c54e4bc81a89558f14e71d3d9f)

src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 451713adb7383bb786feb90cd7952943f1738c03..99d6969d28dbb54585ba181a0eadd74a82b58800 100644 (file)
@@ -5934,9 +5934,8 @@ next:
   }
 
   if (opt_cmd == OPT_OBJECTS_EXPIRE) {
-    int ret = store->process_expire_objects();
-    if (ret < 0) {
-      cerr << "ERROR: process_expire_objects() processing returned error: " << cpp_strerror(-ret) << std::endl;
+    if (!store->process_expire_objects()) {
+      cerr << "ERROR: process_expire_objects() processing returned error." << std::endl;
       return 1;
     }
   }
index 51c6ef990dfd766bf4ccee7d6a53e5c55d7f211a..8cb9bff17d120293cf8649e01e6b60321bdbeb6a 100644 (file)
@@ -13027,10 +13027,9 @@ int RGWRados::process_lc()
   return lc->process();
 }
 
-int RGWRados::process_expire_objects()
+bool RGWRados::process_expire_objects()
 {
-  obj_expirer->inspect_all_shards(utime_t(), ceph_clock_now());
-  return 0;
+  return obj_expirer->inspect_all_shards(utime_t(), ceph_clock_now());
 }
 
 int RGWRados::cls_rgw_init_index(librados::IoCtx& index_ctx, librados::ObjectWriteOperation& op, string& oid)
index 7983b0534366c37b20d794f3773cfba7a59b25e8..bffeed265abc70ea3f6fc3591f7ac8c00d423505 100644 (file)
@@ -3638,7 +3638,7 @@ public:
 
   int list_gc_objs(int *index, string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated);
   int process_gc(bool expired_only);
-  int process_expire_objects();
+  bool process_expire_objects();
   int defer_gc(void *ctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj);
 
   int process_lc();