[SERVER-35276] "Cannot run getMore" on sharded cluster with auth after listIndexes Created: 29/May/18  Updated: 30/May/18  Resolved: 30/May/18

Status: Closed
Project: Core Server
Component/s: Querying, Security, Sharding
Affects Version/s: 4.0.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Samuel Rossi (Inactive) Assignee: Misha Tyulenev
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-34517 getMore in session while running with... Closed
Operating System: ALL
Steps To Reproduce:

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=="
    )
  }
})

Participants:

 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.


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