@@ -252,10 +252,10 @@ void RGWObjectCtx::set_compressed(const rgw_obj& obj) {
252252 objs_state[obj].state .compressed = true ;
253253}
254254
255- void RGWObjectCtx::set_atomic (const rgw_obj& obj) {
255+ void RGWObjectCtx::set_atomic (const rgw_obj& obj, bool atomic ) {
256256 std::unique_lock wl{lock};
257257 assert (!obj.empty ());
258- objs_state[obj].state .is_atomic = true ;
258+ objs_state[obj].state .is_atomic = atomic ;
259259}
260260void RGWObjectCtx::set_prefetch_data (const rgw_obj& obj) {
261261 std::unique_lock wl{lock};
@@ -2959,7 +2959,7 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx,
29592959 return 0 ;
29602960 }
29612961
2962- obj_ctx.set_atomic (obj);
2962+ obj_ctx.set_atomic (obj, true );
29632963
29642964 RGWObjState * state = nullptr ;
29652965 RGWObjManifest *manifest = nullptr ;
@@ -2999,7 +2999,7 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx,
29992999 gen_rand_obj_instance_name (&dest_obj);
30003000 }
30013001
3002- obj_ctx.set_atomic (dest_obj);
3002+ obj_ctx.set_atomic (dest_obj, true );
30033003
30043004 rgw_zone_id no_zone;
30053005
@@ -3100,8 +3100,8 @@ int RGWRados::swift_versioning_restore(RGWObjectCtx& obj_ctx,
31003100 gen_rand_obj_instance_name (&obj);
31013101 }
31023102
3103- obj_ctx.set_atomic (archive_obj);
3104- obj_ctx.set_atomic (obj);
3103+ obj_ctx.set_atomic (archive_obj, true );
3104+ obj_ctx.set_atomic (obj, true );
31053105
31063106 jspan_context no_trace{false , false };
31073107
@@ -5294,7 +5294,7 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx,
52945294 real_time read_mtime;
52955295 uint64_t obj_size;
52965296
5297- obj_ctx.set_atomic (obj);
5297+ obj_ctx.set_atomic (obj, true );
52985298 RGWRados::Object op_target (this , bucket_info, obj_ctx, obj);
52995299 RGWRados::Object::Read read_op (&op_target);
53005300
@@ -6095,7 +6095,7 @@ static int resync_encrypted_multipart(const DoutPrefixProvider* dpp,
60956095 const RGWObjState& state)
60966096{
60976097 // only overwrite if the tag hasn't changed
6098- obj_ctx.set_atomic (state.obj );
6098+ obj_ctx.set_atomic (state.obj , true );
60996099
61006100 // make a tiny adjustment to the existing mtime so that fetch_remote_obj()
61016101 // won't return ERR_NOT_MODIFIED when resyncing the object
@@ -6649,6 +6649,11 @@ int RGWRados::get_olh_target_state(const DoutPrefixProvider *dpp, RGWObjectCtx&
66496649 return r;
66506650 }
66516651
6652+ // if prefetch was requested, apply it to the target too
6653+ if (olh_state->prefetch_data ) {
6654+ obj_ctx.set_prefetch_data (target);
6655+ }
6656+
66526657 return get_obj_state (dpp, &obj_ctx, bucket_info, target, psm, false , y);
66536658}
66546659
0 commit comments