]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: delete_obj_index() takes mtime for bilog 31649/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 6 May 2019 19:01:07 +0000 (15:01 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 14 Nov 2019 18:25:41 +0000 (19:25 +0100)
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 a024a13af74ba4895f162b4ca1eeab2c37058e25..dc2286074c8ee74aed14bc273d0653f96fab79c0 100644 (file)
@@ -9388,7 +9388,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);
@@ -9405,10 +9405,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)
@@ -13752,7 +13749,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;
        }
@@ -14619,7 +14616,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 ac6d2b5213f394333fe253ac70ef54c8f6d7c8ea..9a71a9b302a860e29185b45ea8ff6b4fad3d98d3 100644 (file)
@@ -3274,7 +3274,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.