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

"Cannot run getMore" on sharded cluster with auth after listIndexes

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.0-rc0
    • Component/s: Querying, Security, Sharding
    • None
    • ALL
    • Hide

      1. Start up a sharded cluster with auth enabled (e.g. with mongo-orchestration)
      2. Create a second index (beyond the one on _id) to ensure that initial call does not exhaust the results. For example:

      db.test.createIndex({ name: 1 })
      

      3. Open a new shell and run a listIndexes command with a session specified and a batch size of 1. For example:

      db.runCommand({
        "listIndexes": "test",
        "cursor": {
          "batchSize": 1
        },
        "$clusterTime": {
          "clusterTime": Timestamp(
              1527628984,
              3
          ), 
          "signature": {
            "hash": BinData(
              0,
              "qoVhY5vejrZCjmf2ZhUupCkjytY="
            ),
            "keyId": 6561100244480688000
          }
        },
        "lsid": {
          "id": BinData(
            4,
            "lzdMPBKTSAqxDLUMXAZVqA=="
          )
        }
      })
      

      4. Using the cursor id returned from the previous command, construct a getMore from the same session, which will return the error. For example:

      db.runCommand({
        "getMore": NumberLong("6826835382233548157"),
        "collection": "$cmd.listIndexes.test",
        "batchSize": 1,
        "$clusterTime": {
          "clusterTime": Timestamp(
              1527628984,
              3
          ),
          "signature": {
            "hash": BinData(
              0,
              "qoVhY5vejrZCjmf2ZhUupCkjytY="
            ),
            "keyId": 6561100244480688000
          }
        },
        "lsid": {
          "id": BinData(
            4,
            "lzdMPBKTSAqxDLUMXAZVqA=="
          )
        }
      })
      
      Show
      1. Start up a sharded cluster with auth enabled (e.g. with mongo-orchestration) 2. Create a second index (beyond the one on _id) to ensure that initial call does not exhaust the results. For example: db.test.createIndex({ name: 1 }) 3. Open a new shell and run a listIndexes command with a session specified and a batch size of 1. For example: db.runCommand({ "listIndexes" : "test" , "cursor" : { "batchSize" : 1 }, "$clusterTime" : { "clusterTime" : Timestamp( 1527628984, 3 ), "signature" : { "hash" : BinData( 0, "qoVhY5vejrZCjmf2ZhUupCkjytY=" ), "keyId" : 6561100244480688000 } }, "lsid" : { "id" : BinData( 4, "lzdMPBKTSAqxDLUMXAZVqA==" ) } }) 4. Using the cursor id returned from the previous command, construct a getMore from the same session, which will return the error. For example: db.runCommand({ "getMore" : NumberLong( "6826835382233548157" ), "collection" : "$cmd.listIndexes.test" , "batchSize" : 1, "$clusterTime" : { "clusterTime" : Timestamp( 1527628984, 3 ), "signature" : { "hash" : BinData( 0, "qoVhY5vejrZCjmf2ZhUupCkjytY=" ), "keyId" : 6561100244480688000 } }, "lsid" : { "id" : BinData( 4, "lzdMPBKTSAqxDLUMXAZVqA==" ) } })

      When trying to run a getMore command after a listIndexes with a batch size on sharded clusters with auth enabled on 4.0.0-rc0, the server returns an error saying that the getMore is being run on a different session than the original command.

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: