[SERVER-71874] Return early if empty response detected from _clusterQueryWithoutShardKey in findAndModify two phase protocol Created: 05/Dec/22  Updated: 29/Oct/23  Resolved: 12/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Sanika Phanse (Inactive) Assignee: Sanika Phanse (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Gantt End to End
has to be finished together with SERVER-71851 Clean up find_and_modify_without_shar... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-12-12, Sharding NYC 2022-12-26
Participants:
Linked BF Score: 129

 Description   

Add

if (!queryResponse.getTargetDoc()) {
    // construct findAndModify response for no find match
    return SemiFuture<void>::makeReady();
}



 Comments   
Comment by Githook User [ 09/Dec/22 ]

Author:

{'name': 'Sanika Phanse', 'email': 'sanika.phanse@mongodb.com', 'username': 'sphanse99'}

Message: SERVER-71874 Return early if empty response detected from _clusterQueryWithoutShardKey in findAndModify two phase protocol
Branch: master
https://github.com/mongodb/mongo/commit/4389db9fa124485d45dae5451944ad904e28c696

Comment by Sanika Phanse (Inactive) [ 07/Dec/22 ]

Expected response of a findAndModify that does not match the query and has

{upsert:false}

:

"lastErrorObject" : {
	"n" : 0,
	"updatedExisting" : false
},
"value" : null,
"ok" : 1,
"$clusterTime" : {
	"clusterTime" : Timestamp(1670343264, 68),
	"signature" : {
		"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
		"keyId" : NumberLong(0)
	}
},
"operationTime" : Timestamp(1670343264, 62)
}

Currently, the response only contains "ok: 1" onwards. Solution is to construct a findAndModify response with correct fields before returning the semifuture in the description above.

Generated at Thu Feb 08 06:20:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.