[SERVER-29434] Don't accept empty timestamps for readConcern afterClusterTime Created: 02/Jun/17  Updated: 30/Oct/23  Resolved: 07/Jun/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.5.8
Fix Version/s: 3.5.9

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

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

./mongo --nodb
let st = new ShardingTest({rs: {enableMajorityReadConcern: ""}});
st.s.getDB("test").insert({x: 1});
st.s.getDB("test").runCommand({find: "foo", readConcern: {level: "majority", afterClusterTime: Timestamp()}});

Sprint: Sharding 2017-06-19
Participants:
Linked BF Score: 0

 Description   

Right now, a user can trigger this invariant in _waitUntilClusterTimeForRead by submitting a request with:

 readConcern: {level: "majority", afterClusterTime: Timestamp()} 

or

 readConcern: {level: "majority", afterClusterTime: Timestamp(0, 0)} 

I think the easiest way to fix this would be returning ErrorCodes::InvalidOptions in read_concern_args.cpp::initialize if _clusterTime == LogicalTime::kUninitialized. We could also remove the invariant, or change it to a uassert.



 Comments   
Comment by Githook User [ 07/Jun/17 ]

Author:

{u'username': u'jsmulrow', u'name': u'Jack Mulrow', u'email': u'jack.mulrow@mongodb.com'}

Message: SERVER-29434 Don't accept empty timestamps for readConcern afterClusterTime
Branch: master
https://github.com/mongodb/mongo/commit/00dd041c28f0f88cb2478b3be22c50f97515b437

Comment by Githook User [ 06/Jun/17 ]

Author:

{u'username': u'judahschvimer', u'name': u'Judah Schvimer', u'email': u'judah@mongodb.com'}

Message: Revert "SERVER-29434 Don't accept empty timestamps for readConcern afterClusterTime"

This reverts commit 783d11c4ea92784dc6ca0cc0419403c454c9ec9c.
Branch: master
https://github.com/mongodb/mongo/commit/39cd3e84fc60f67112f2c1182207dcf9b13be967

Comment by Githook User [ 06/Jun/17 ]

Author:

{u'username': u'jsmulrow', u'name': u'Jack Mulrow', u'email': u'jack.mulrow@mongodb.com'}

Message: SERVER-29434 Don't accept empty timestamps for readConcern afterClusterTime
Branch: master
https://github.com/mongodb/mongo/commit/783d11c4ea92784dc6ca0cc0419403c454c9ec9c

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