[SERVER-48301] find command should reject $_internalReadAtClusterTime values less than afterClusterTime Created: 19/May/20  Updated: 29/Oct/23  Resolved: 11/Jun/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.5.1
Fix Version/s: 4.7.0

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

Issue Links:
Depends
Related
related to SERVER-28812 Invariant failure when specifying rea... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

(function() {
 
let rst = new ReplSetTest({nodes: 1});
rst.startSet();
rst.initiate();
 
const primary = rst.getPrimary();
const session = primary.startSession({causalConsistency: false});
const db = session.getDatabase('test');
assert.commandWorked(db.test.insert({a: 1}));
 
let time1 = session.getOperationTime();
 
assert.commandWorked(db.test.insert({a: 2}));
let time2 = session.getOperationTime();
 
// Crashes
assert.commandWorked(assert.commandWorked(db.runCommand({
    find: 'test',
    $_internalReadAtClusterTime: time1,
    readConcern: {afterClusterTime: time2},
})));
 
rst.stopSet();
})();

Sprint: Execution Team 2020-06-15
Participants:
Linked BF Score: 11

 Description   

I added an invariant on the master branch that fails when commands attempt to read at a timestamp that is less than the afterClusterTime readConcern argument, which is contradictory.

"$_internalReadAtClusterTime" can specify any timestamp and afterClusterTime it wants, easily crashing the server with a simple request.

We should reject find and getMore commands formed in this way. dbhash does not accept afterClusterTime.



 Comments   
Comment by Githook User [ 11/Jun/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48301 find command should reject $_internalReadAtClusterTime values less than afterClusterTime
Branch: master
https://github.com/mongodb/mongo/commit/0f707044926e0cec422294520f9e42d777818b1f

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