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

lsid-related error on getMore command in sharded cluster

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Query
    • ALL
    • Hide

      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"
            }
          }
        }
      }
      
      Show
      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" } } } }

      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.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: