Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31481

mongos rejects $clusterTime even when auth'd as __system user

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc1
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Hide
      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();
      })();
      
      Show
      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(); })();
    • Sharding 2017-10-23

      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
      

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: