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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 4.0.0-rc0
    • Fix Version/s: None
    • Component/s: Querying, Security, Sharding
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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==" ) } })

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: