[SERVER-46393] Always check client last operation time when computing operationTime to append to the response Created: 25/Feb/20  Updated: 29/Oct/23  Resolved: 27/Feb/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.4, 4.0.22, 4.2.12

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Sharding 2020-03-09
Participants:
Linked BF Score: 5

 Description   

Currently, if a command has an uninitialized startOperationTime (because the client still has uninitialized opTime when the command starts running), computeOperationTime returns the replication coordinator's lastAppliedOpTime as the operationTime to append to the response for the command. This operationTime could sometimes be later than the opTime for the operation performed by the command. To prevent this, this block of code should be removed so that we always check and try to use the client last operation time when possible.



 Comments   
Comment by Githook User [ 15/Nov/20 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'cheahuychou.mao@mongodb.com', 'username': 'cheahuychou'}

Message: SERVER-46393 Always check client last operation time when computing operationTime to append to the response

(cherry picked from commit 679d1e1028ddbdd1ac5778f3e0ab0cb3ffd5ee27)
Branch: v4.2
https://github.com/mongodb/mongo/commit/e3b5f9046975f5e385d68ecf92f8d76d7278beab

Comment by Githook User [ 14/Nov/20 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'cheahuychou.mao@mongodb.com', 'username': 'cheahuychou'}

Message: SERVER-46393 Always check client last operation time when computing operationTime to append to the response

(cherry picked from commit 679d1e1028ddbdd1ac5778f3e0ab0cb3ffd5ee27)
Branch: v4.0
https://github.com/mongodb/mongo/commit/fc402b25bc4d94565a6ede47e7fb2e6452452bd3

Comment by Prashant Mital (Inactive) [ 10/Apr/20 ]

Thanks esha.maharishi!

Comment by Esha Maharishi (Inactive) [ 10/Apr/20 ]

Hi prashant.mital, I don't think this ticket is related to the problem you're describing. This ticket is about what value is returned for operationTime, not whether an operationTime field is returned at all.

Comment by Githook User [ 27/Feb/20 ]

Author:

{'name': 'Cheahuychou Mao', 'username': 'cheahuychou', 'email': 'cheahuychou.mao@mongodb.com'}

Message: SERVER-46393 Always check client last operation time when computing operationTime to append to the response
Branch: master
https://github.com/mongodb/mongo/commit/679d1e1028ddbdd1ac5778f3e0ab0cb3ffd5ee27

Generated at Thu Feb 08 05:11:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.