[SERVER-31481] mongos rejects $clusterTime even when auth'd as __system user Created: 09/Oct/17  Updated: 30/Oct/23  Resolved: 13/Oct/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.6.0-rc1

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Misha Tyulenev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-31456 Concurrency framework doesn't enforce... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

python buildscripts/resmoke.py --suites=sharding_auth repro_cache_reader_dummy_key.js

repro_cache_reader_dummy_key.js

(function() {
    "use strict";
 
    const st = new ShardingTest({mongos: 1, config: 1, shards: 0});
 
    let clusterTime;
 
    {
        const cmdObj = {insert: "mycoll", documents: [{_id: 0}]};
        const res = st.c0.getDB("config").runCommand(cmdObj);
        assert.commandWorked(res);
 
        clusterTime = res.$clusterTime;
    }
 
    {
        const cmdObj = {
            find: "mycoll",
            limit: 1,
            singleBatch: true,
            $clusterTime: clusterTime
        };
 
        const res = st.s0.getDB("config").runCommand(cmdObj);
        assert.commandWorked(res, "Command request was: " + tojsononeline(cmdObj));
    }
 
    st.stop();
})();

Sprint: Sharding 2017-10-23
Participants:

 Description   

misha.tyulenev asked me to file this ticket. This is the general form of the failures that are occurring in my patch build for SERVER-31456 that also includes a fix for gossiping the clusterTime from the mongo shell.

[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.692-0400 Authenticating as user __system with mechanism null on connection: connection to hanamizu:20010
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.696-0400 c20010| 2017-10-09T19:28:42.695-0400 I ACCESS   [conn1] Successfully authenticated as principal __system on local
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.696-0400 Authenticating as user __system with mechanism null on connection: connection to hanamizu:20011
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.700-0400 s20011| 2017-10-09T19:28:42.700-0400 I ACCESS   [conn1] Successfully authenticated as principal __system on local
...
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.712-0400 2017-10-09T19:28:42.710-0400 E QUERY    [thread1] Error: command failed: {
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.712-0400 	"ok" : 0,
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.713-0400 	"errmsg" : "Cache Reader No keys found for HMAC that is valid for time: { ts: Timestamp 1507591722000|7 } with id: 0",
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.713-0400 	"code" : 211,
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.713-0400 	"codeName" : "KeyNotFound"
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.713-0400 } : Command request was: {  "find" : "mycoll",  "limit" : 1,  "singleBatch" : true,  "$clusterTime" : {  "clusterTime" : Timestamp(1507591722, 7),  "signature" : {  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),  "keyId" : NumberLong(0) } } } :
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.714-0400 _getErrorWithCode@src/mongo/shell/utils.js:25:13
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.714-0400 doassert@src/mongo/shell/assert.js:16:14
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.714-0400 assert.commandWorked@src/mongo/shell/assert.js:403:5
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.714-0400 @repro_cache_reader_dummy_key.js:25:1
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.714-0400 @repro_cache_reader_dummy_key.js:1:2
[js_test:repro_cache_reader_dummy_key] 2017-10-09T19:28:42.715-0400 failed to load: repro_cache_reader_dummy_key.js



 Comments   
Comment by Githook User [ 13/Oct/17 ]

Author:

{'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev', 'username': 'mikety'}

Message: "SERVER-31481 skip cluster time validation for the __system user in mongos""

This reverts commit 8205b768ca58b68b7aaf3b3b1c7a544f8d044d5a.
Branch: master
https://github.com/mongodb/mongo/commit/8210549ab754524b155ea45eb6675d717873cb21

Comment by Githook User [ 11/Oct/17 ]

Author:

{'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev', 'username': 'mikety'}

Message: Revert "SERVER-31481 skip cluster time validation for the __system user in mongos"

This reverts commit 1acb9c0d552c080800b71047234877372eeb8b89.
Branch: master
https://github.com/mongodb/mongo/commit/8205b768ca58b68b7aaf3b3b1c7a544f8d044d5a

Comment by Githook User [ 11/Oct/17 ]

Author:

{'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev', 'username': 'mikety'}

Message: SERVER-31481 skip cluster time validation for the __system user in mongos
Branch: master
https://github.com/mongodb/mongo/commit/1acb9c0d552c080800b71047234877372eeb8b89

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