]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: prevent LC from reading stale head when transitioning object 31214/head
authorIlsoo Byun <ilsoobyun@linecorp.com>
Tue, 29 Oct 2019 09:30:12 +0000 (18:30 +0900)
committerIlsoo Byun <ilsoobyun@linecorp.com>
Tue, 29 Oct 2019 09:30:12 +0000 (18:30 +0900)
Fixes: https://tracker.ceph.com/issues/42429
Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
src/rgw/rgw_rados.cc

index e3ef936d255ee43c6ded6813d29b29ff77d88fef..916bebb568f87ba06e456b0f05ac5e035e61568d 100644 (file)
@@ -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,