From: Casey Bodley Date: Mon, 6 May 2019 19:01:07 +0000 (-0400) Subject: rgw: delete_obj_index() takes mtime for bilog X-Git-Tag: v13.2.7~201^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=07004d319dabf58231806b4260ec2c8f93e6f8c2;p=ceph.git rgw: delete_obj_index() takes mtime for bilog 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 (cherry picked from commit 0316a81875ae93a06841d532bf3548c81370296e) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3ca45acacd58f..09b73f072d413 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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& 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; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index fe4e8e708724e..452ae093bffb0 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -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.