]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: delete_obj_index() takes mtime for bilog 29262/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 6 May 2019 19:01:07 +0000 (15:01 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 24 Jul 2019 12:47:02 +0000 (14:47 +0200)
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>
(cherry picked from commit 0316a81875ae93a06841d532bf3548c81370296e)

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

index 3ca45acacd58fd20b5fda85700d58caf1fcdfa62..09b73f072d4133f442323012e41444cb30a627ca 100644 (file)
@@ -9370,7 +9370,7 @@ int RGWRados::delete_system_obj(rgw_raw_obj& obj, RGWObjVersionTracker *objv_tra
   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);
@@ -9387,10 +9387,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)
@@ -13635,7 +13632,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;
        }
@@ -14502,7 +14499,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 fe4e8e708724ef3d376e7293ce6579e7198f350e..452ae093bffb077eee1f87c9386d1ca8922624b2 100644 (file)
@@ -3298,7 +3298,7 @@ public:
   virtual int delete_system_obj(rgw_raw_obj& src_obj, RGWObjVersionTracker *objv_tracker = NULL);
 
   /** 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);
 
   /**
    * Get an attribute for a system object.