-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
-
sHello, we have problems updating 11-sharded mongodb cluster from 4.0.21 (minor version update won't fix this, since there are no mentions of this bug in changelog) to 4.2. We want to update mongos without a downtime, which with 11 primaries and then mongos rolling update - will be significant.
After updating all confivsvrs and secondary replicas, when switching master, we get errors
$geoNear no longer supports the 'limit' parameter. Use a $limit stage instead.
Thing is - we don't have any limits in queries.
It looks like mongos adding hardcoded 100 limit to queries, which results in errors above
https://github.com/mongodb/mongo/blob/r4.0.21/src/mongo/db/pipeline/document_source_geo_near.cpp#L282
kDefaultLimit = 100,
4.2 uses consctructor https://github.com/mongodb/mongo/blob/r4.2.17/src/mongo/db/pipeline/document_source_geo_near.cpp#L236
notice: num: 100, while query doesn't have any limit:
jojo-db2-1 2022-02-25T10:53:34.165+0300 I COMMAND [conn7462301] command jojo.bb_delivery_point appName: "MongoDB Shell" command: geoNear { geoNear: "bb_delivery_point", near: [ 57.766666, 37.62222 ], num: 100, maxDistance: 5000000.0, query: {}, collation: { locale: "simple" }, spherical: true, distanceMultiplier: 1.0, $db: "jojo" } planSummary: GEO_NEAR_2D { location: "2d" } keysExamined:489 docsExamined:462 numYields:4 reslen:126672 locks:{ Global: { acquireCount: { r: 5 } }, Database: { acquireCount: { r: 5 } }, Collection: { acquireCount: { r: 5 } } } storage:{} protocol:op_msg 322ms jojo-db2-1 2022-02-25T10:53:34.167+0300 I COMMAND [conn7462301] command jojo.bb_delivery_point appName: "MongoDB Shell" command: getMore { getMore: 5753461764780339751, collection: "bb_delivery_point", batchSize: 101, lsid: { id: UUID("b90747a7-6cf4-4b24-8161-032033d6baec"), uid: BinData(0, E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855) }, $clusterTime: { clusterTime: Timestamp(1645775613, 5526), signature: { hash: BinData(0, D94D58D7A3E272E81F946C403B32C5E6CBA96D62), keyId: 7033356981284897085 } }, $client: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.21" }, os: { type: "Linux", name: "CentOS Linux release 7.6.1810 (Core) ", architecture: "x86_64", version: "Kernel 3.10.0-1160.2.2.el7.x86_64" }, mongos: { host: "jojo-db0-2.p:27018", client: "127.0.0.1:49737", version: "4.0.21" } }, $configServerState: { opTime: { ts: Timestamp(1645775613, 4622), t: 34 } }, $db: "jojo" } originatingCommand: { aggregate: "bb_delivery_point", pipeline: [ { $geoNear: { near: [ 57.766666, 37.62222 ], distanceField: "dis", limit: 100, maxDistance: 5000000.0, query: {}, spherical: true, distanceMultiplier: 1.0 } } ], fromMongos: true, needsMerge: true, mergeByPBRT: false, collation: { locale: "simple" }, cursor: { batchSize: 0 }, allowImplicitCollectionCreation: true, shardVersion: [ Timestamp(7200, 0), ObjectId('58ca9326adcf092b7a927230') ], lsid: { id: UUID("b90747a7-6cf4-4b24-8161-032033d6baec"), uid: BinData(0, E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855) }, $clusterTime: { clusterTime: Timestamp(1645775613, 5518), signature: { hash: BinData(0, D94D58D7A3E272E81F946C403B32C5E6CBA96D62), keyId: 7033356981284897085 } }, $client: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.21" }, os: { type: "Linux", name: "CentOS Linux release 7.6.1810 (Core) ", architecture: "x86_64", version: "Kernel 3.10.0-1160.2.2.el7.x86_64" }, mongos: { host: "jojo-db0-2.p:27018", client: "127.0.0.1:49737", version: "4.0.21" } }, $configServerState: { opTime: { ts: Timestamp(1645775613, 4622), t: 34 } }, $db: "jojo" } cursorid:5753461764780339751 keysExamined:0 docsExamined:0 cursorExhausted:1 numYields:0 nreturned:100 reslen:128134 locks:{ Global: { acquireCount: { r: 9 } }, Database: { acquireCount: { r: 6 } }, Collection: { acquireCount: { r: 5 } } } storage:{} protocol:op_msg 324ms [root@jojo-logs1 ~]# cat /logs/jojo_mongodb/mongos.log | grep '57.766666' jojo-db0-2 2022-02-25T10:53:34.172+0300 I COMMAND [conn27254798] command jojo.bb_delivery_point appName: "MongoDB Shell" command: aggregate { aggregate: "bb_delivery_point", pipeline: [ { $geoNear: { near: [ 57.766666, 37.62222 ], distanceField: "dis", maxDistance: 5000000.0, spherical: true } } ], cursor: {}, lsid: { id: UUID("b90747a7-6cf4-4b24-8161-032033d6baec") }, $clusterTime: { clusterTime: Timestamp(1645775611, 226), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, $db: "jojo" } nShards:11 cursorExhausted:1 numYields:0 nreturned:100 reslen:132462 protocol:op_msg 331ms
Thanks,
Rinat
- is related to
-
SERVER-22949 Remove default limit from $geoNear aggregation stage
- Closed