]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: delete_obj_index() takes mtime for bilog 27980/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 6 May 2019 19:01:07 +0000 (15:01 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 6 May 2019 19:05:57 +0000 (15:05 -0400)
writing an empty timestamp to the bilog prevents other zones from
applying the delete. this means that the --bypass-gc flag for
'radosgw-admin bucket rm' doesn't work in multisite

Fixes: http://tracker.ceph.com/issues/24991
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 476e5b647dad866a73118cdc347b87ca2ebff2ee..0a2ead992b63718b7113b7586879132d6ccb16e1 100644 (file)
@@ -5626,7 +5626,7 @@ int RGWRados::delete_raw_obj(const rgw_raw_obj& obj)
   return 0;
 }
 
-int RGWRados::delete_obj_index(const rgw_obj& obj)
+int RGWRados::delete_obj_index(const rgw_obj& obj, ceph::real_time mtime)
 {
   std::string oid, key;
   get_obj_bucket_and_oid_loc(obj, oid, key);
@@ -5643,10 +5643,7 @@ int RGWRados::delete_obj_index(const rgw_obj& obj)
   RGWRados::Bucket bop(this, bucket_info);
   RGWRados::Bucket::UpdateIndex index_op(&bop, obj);
 
-  real_time removed_mtime;
-  int r = index_op.complete_del(-1 /* pool */, 0, removed_mtime, NULL);
-
-  return r;
+  return index_op.complete_del(-1 /* pool */, 0, mtime, NULL);
 }
 
 static void generate_fake_tag(RGWRados *store, map<string, bufferlist>& attrset, RGWObjManifest& manifest, bufferlist& manifest_bl, bufferlist& tag_bl)
@@ -9521,7 +9518,7 @@ int RGWRados::check_disk_state(librados::IoCtx io_ctx,
 
       if (loc.key.ns == RGW_OBJ_NS_MULTIPART) {
        dout(10) << "check_disk_state(): removing manifest part from index: " << loc << dendl;
-       r = delete_obj_index(loc);
+       r = delete_obj_index(loc, astate->mtime);
        if (r < 0) {
          dout(0) << "WARNING: delete_obj_index() returned r=" << r << dendl;
        }
@@ -10121,7 +10118,7 @@ int RGWRados::delete_obj_aio(const rgw_obj& obj,
   handles.push_back(c);
 
   if (keep_index_consistent) {
-    ret = delete_obj_index(obj);
+    ret = delete_obj_index(obj, astate->mtime);
     if (ret < 0) {
       lderr(cct) << "ERROR: failed to delete obj index with ret=" << ret << dendl;
       return ret;
index 90a2548d961946420bd03c2a4623b8515b342299..6c948b1d8144c25fca0a0d56bd3a8b6d90382d64 100644 (file)
@@ -2015,7 +2015,7 @@ public:
   int delete_raw_obj(const rgw_raw_obj& obj);
 
   /** Remove an object from the bucket index */
-  int delete_obj_index(const rgw_obj& obj);
+  int delete_obj_index(const rgw_obj& obj, ceph::real_time mtime);
 
   /**
    * Set an attr on an object.