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

Resolve problem with using op session with direct client in POC

    • Fully Compatible
    • Sharding NYC 2022-04-04, Sharding NYC 2022-04-18
    • 4
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      Repro:

      buildscripts/resmoke.py run --suite sharding --numShards=1 --numReplSetNodes=3 --catalogShard=any jstests/sharding/addshard1.js

      Need to investigate, but this may be a common failure. See SERVER-35180 why this safeguard was implemented to begin with.

      Error:

      [js_test:addshard1] s20021| {"t":{"$date":"2022-03-23T23:00:57.855+00:00"},"s":"D1", "c":"ASSERT",   "id":23074,   "ctx":"conn6","msg":"User assertion","attr":{"error":"Location50891: Invalid to set operation session info in a direct client","file":"src/mongo/util/future_impl.h","line":1087}}
      [js_test:addshard1] s20021| {"t":{"$date":"2022-03-23T23:00:57.855+00:00"},"s":"D1", "c":"SHARDING", "id":22772,   "ctx":"conn6","msg":"Exception thrown while processing command","attr":{"db":"admin","headerId":238,"error":"Location50891: Invalid to set operation session info in a direct client"}}
      [js_test:addshard1] s20021| {"t":{"$date":"2022-03-23T23:00:57.855+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn6","msg":"Slow query","attr":{"type":"command","ns":"testDB.foo","appName":"MongoDB Shell","command":{"shardcollection":"testDB.foo","key":{"a":1},"lsid":{"id":{"$uuid":"cfc58386-5173-412c-a8b9-c1092c53e1ff"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1648076457,"i":23}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"admin"},"numYields":0,"ok":0,"errMsg":"Invalid to set operation session info in a direct client","errName":"Location50891","errCode":50891,"reslen":270,"readConcern":{"level":"local","provenance":"implicitDefault"},"remote":"127.0.0.1:37500","protocol":"op_msg","durationMillis":34}}
      [js_test:addshard1] uncaught exception: Error: command { "shardcollection" : "testDB.foo", "key" : { "a" : 1 } } failed: {
      [js_test:addshard1] 	"ok" : 0,
      [js_test:addshard1] 	"errmsg" : "Invalid to set operation session info in a direct client",
      [js_test:addshard1] 	"code" : 50891,
      [js_test:addshard1] 	"codeName" : "Location50891",
      [js_test:addshard1] 	"$clusterTime" : {
      [js_test:addshard1] 		"clusterTime" : Timestamp(1648076457, 38),
      [js_test:addshard1] 		"signature" : {
      [js_test:addshard1] 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      [js_test:addshard1] 			"keyId" : NumberLong(0)
      [js_test:addshard1] 		}
      [js_test:addshard1] 	},
      [js_test:addshard1] 	"operationTime" : Timestamp(1648076457, 38)
      [js_test:addshard1] } :
      [js_test:addshard1] _getErrorWithCode@src/mongo/shell/utils.js:24:13
      [js_test:addshard1] ShardingTest/this.adminCommand@src/mongo/shell/shardingtest.js:415:15
      [js_test:addshard1] @jstests/sharding/addshard1.js:73:3
      
      

      A possible fix could be to strip the session of this is a local client from a shard to config sever in a catalog shard.

            Assignee:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Reporter:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: