]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: "radosgw-admin objects expire" always returns ok even if the process
authorZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 20 Jun 2018 03:45:45 +0000 (11:45 +0800)
committerZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 20 Jun 2018 03:45:45 +0000 (11:45 +0800)
fails.

Fixes: http://tracker.ceph.com/issues/24592
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index e7c777a1e9cdc6c38321c19084608de5e9ffad24..155542d62df39b7c0853fd57f2cf916f06c5d623 100644 (file)
@@ -5883,9 +5883,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 767196612753a760ac5cc24446a33124c25b305e..8aef0918414768eebbdb61e2adb59cf2dd0e0f5c 100644 (file)
@@ -13078,10 +13078,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 5d3bdd2738c171e6c2472e9e72fe24838f22ea39..cadf5143f0a1550765321d9c2efed9e6b5e2b748 100644 (file)
@@ -3637,7 +3637,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();