[SERVER-34509] lsid-related error on getMore command in sharded cluster Created: 16/Apr/18  Updated: 06/Dec/22  Resolved: 16/Apr/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-34204 Tailable cursor fails on getMore agai... Closed
Assigned Teams:
Query
Operating System: ALL
Steps To Reproduce:

Mongo Orchestration configs:

{
  "id": "shard_cluster_1",
  "shards": [
    {
      "id": "sh01",
      "shardParams": {
        "members": [{
          "procParams": {
            "ipv6": true,
            "bind_ip": "127.0.0.1,::1",
            "shardsvr": true,
            "setParameter" : { "enableTestCommands": 1 },
            "port": 27217
          }
        }]
      }
    },
    {
      "id": "sh02",
      "shardParams": {
        "members": [{
          "procParams": {
            "ipv6": true,
            "bind_ip": "127.0.0.1,::1",
            "shardsvr": true,
            "setParameter" : { "enableTestCommands": 1 },
            "port": 27218
          }
        }]
      }
    }
  ],
  "routers": [
    {
      "ipv6": true,
      "bind_ip": "127.0.0.1,::1",
      "port": 27017
    },
    {
      "ipv6": true,
      "bind_ip": "127.0.0.1,::1",
      "port": 27018
    }
  ]
}

Command Sequence:

// Command
{
  "create" : "com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
  "autoIndexId" : true,
  "capped" : true,
  "size" : 1000,
  "$db" : "JavaDriverTest",
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 19
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "lsid" : {
    "id" : {
      "$binary" : {
        "base64" : "gNGWQynURVmqEihE9I1j6g==",
        "subType" : "04"
      }
    }
  }
}
// Response
{
  "ok" : 1.0,
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 24
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "operationTime" : {
    "$timestamp" : {
      "t" : 1523914364,
      "i" : 24
    }
  }
}
 
// Command
{
  "insert" : "com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
  "ordered" : true,
  "$db" : "JavaDriverTest",
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 24
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "lsid" : {
    "id" : {
      "$binary" : {
        "base64" : "gNGWQynURVmqEihE9I1j6g==",
        "subType" : "04"
      }
    }
  },
  "documents" : [{
      "_id" : 1,
      "ts" : {
        "$timestamp" : {
          "t" : 5,
          "i" : 0
        }
      }
    }]
}
// Response
{
  "ok" : 1.0,
  "n" : 1,
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 25
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "operationTime" : {
    "$timestamp" : {
      "t" : 1523914364,
      "i" : 25
    }
  }
}
 
// Command
{
  "find" : "com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
  "filter" : {
    "ts" : {
      "$gte" : {
        "$timestamp" : {
          "t" : 5,
          "i" : 0
        }
      }
    }
  },
  "tailable" : true,
  "awaitData" : true,
  "limit" : 0,
  "batchSize" : 2,
  "$db" : "JavaDriverTest",
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 25
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "lsid" : {
    "id" : {
      "$binary" : {
        "base64" : "gNGWQynURVmqEihE9I1j6g==",
        "subType" : "04"
      }
    }
  }
}
// Response
{
  "cursor" : {
    "firstBatch" : [{
        "_id" : 1,
        "ts" : {
          "$timestamp" : {
            "t" : 5,
            "i" : 0
          }
        }
      }],
    "id" : 8454124330673449293,
    "ns" : "JavaDriverTest.com.mongodb.operation.QueryBatchCursorFunctionalSpecification"
  },
  "ok" : 1.0,
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 25
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "operationTime" : {
    "$timestamp" : {
      "t" : 1523914364,
      "i" : 25
    }
  }
}
 
// Command
{
  "getMore" : 8454124330673449293,
  "collection" : "com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
  "batchSize" : 2,
  "$db" : "JavaDriverTest",
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 25
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "lsid" : {
    "id" : {
      "$binary" : {
        "base64" : "gNGWQynURVmqEihE9I1j6g==",
        "subType" : "04"
      }
    }
  }
}
// Response
{
  "cursor" : {
    "id" : 8454124330673449293,
    "ns" : "JavaDriverTest.com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
    "nextBatch" : []
  },
  "ok" : 1.0,
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 25
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "operationTime" : {
    "$timestamp" : {
      "t" : 1523914364,
      "i" : 25
    }
  }
}
 
// Command
{
  "insert" : "com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
  "ordered" : true,
  "$db" : "JavaDriverTest",
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914364,
        "i" : 25
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "lsid" : {
    "id" : {
      "$binary" : {
        "base64" : "gNGWQynURVmqEihE9I1j6g==",
        "subType" : "04"
      }
    }
  },
  "documents" : [{
      "_id" : 2,
      "ts" : {
        "$timestamp" : {
          "t" : 6,
          "i" : 0
        }
      }
    }]
}
// Response
{
  "ok" : 1.0,
  "n" : 1,
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914365,
        "i" : 1
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "operationTime" : {
    "$timestamp" : {
      "t" : 1523914365,
      "i" : 1
    }
  }
}
 
// Command
{
  "getMore" : 8454124330673449293,
  "collection" : "com.mongodb.operation.QueryBatchCursorFunctionalSpecification",
  "batchSize" : 2,
  "$db" : "JavaDriverTest",
  "$clusterTime" : {
    "clusterTime" : {
      "$timestamp" : {
        "t" : 1523914365,
        "i" : 1
      }
    },
    "signature" : {
      "hash" : {
        "$binary" : {
          "base64" : "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          "subType" : "00"
        }
      },
      "keyId" : 0
    }
  },
  "lsid" : {
    "id" : {
      "$binary" : {
        "base64" : "gNGWQynURVmqEihE9I1j6g==",
        "subType" : "04"
      }
    }
  }
}

Participants:

 Description   

A Java driver test of tailable cursors fails against server version 3.7.3-550-gf7593ed, in a sharded cluster, with the following error:

Query failed with error code 50737 and error message 'Cannot run getMore on cursor 243782631710, which was created in session 80d19643-29d4-4559-aa12-2844f48d63ea - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=, without an lsid'

The test is basically this:

  • create capped collection
  • insert document
  • find command, tailable, with lsid
  • getMore, with same lsid
  • insert document
  • getMore, with same lsid

The complete command/response sequence up until the fail is in the Steps to Reproduce.

The expected result is that the getMore completes without error and returns the just-inserted document.



 Comments   
Comment by Charlie Swanson [ 16/Apr/18 ]

This looks like a duplicate of SERVER-34204.

Comment by David Storch [ 16/Apr/18 ]

We think this is a known issue. charlie.swanson, can you confirm that your patch for SERVER-34204 fixes this scenario?

Comment by Jeffrey Yemin [ 16/Apr/18 ]

I see a similar issue iterating a change stream cursor.

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