@@ -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
@@ -5223,7 +5223,7 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx,
52235223 real_time read_mtime;
52245224 uint64_t obj_size;
52255225
5226- obj_ctx.set_atomic (obj);
5226+ obj_ctx.set_atomic (obj, true );
52275227 RGWRados::Object op_target (this , bucket_info, obj_ctx, obj);
52285228 RGWRados::Object::Read read_op (&op_target);
52295229
@@ -6018,7 +6018,7 @@ static int resync_encrypted_multipart(const DoutPrefixProvider* dpp,
60186018 const RGWObjState& state)
60196019{
60206020 // only overwrite if the tag hasn't changed
6021- obj_ctx.set_atomic (state.obj );
6021+ obj_ctx.set_atomic (state.obj , true );
60226022
60236023 // make a tiny adjustment to the existing mtime so that fetch_remote_obj()
60246024 // won't return ERR_NOT_MODIFIED when resyncing the object
@@ -6572,6 +6572,11 @@ int RGWRados::get_olh_target_state(const DoutPrefixProvider *dpp, RGWObjectCtx&
65726572 return r;
65736573 }
65746574
6575+ // if prefetch was requested, apply it to the target too
6576+ if (olh_state->prefetch_data ) {
6577+ obj_ctx.set_prefetch_data (target);
6578+ }
6579+
65756580 return get_obj_state (dpp, &obj_ctx, bucket_info, target, psm, false , y);
65766581}
65776582
0 commit comments