From 51e4abd9acf2200b33134ab155d60c454af1b201 Mon Sep 17 00:00:00 2001 From: Ilsoo Byun Date: Tue, 29 Oct 2019 18:30:12 +0900 Subject: [PATCH] rgw: prevent LC from reading stale head when transitioning object Fixes: https://tracker.ceph.com/issues/42429 Signed-off-by: Ilsoo Byun --- src/rgw/rgw_rados.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e3ef936d255..916bebb568f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4254,6 +4254,8 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, real_time read_mtime; uint64_t obj_size; + obj_ctx.set_atomic(obj); + RGWRados::Object op_target(this, bucket_info, obj_ctx, obj); RGWRados::Object::Read read_op(&op_target); @@ -4271,6 +4273,9 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, return -ECANCELED; } + attrs.erase(RGW_ATTR_ID_TAG); + attrs.erase(RGW_ATTR_TAIL_TAG); + ret = copy_obj_data(obj_ctx, bucket_info, placement_rule, -- 2.39.5