[SERVER-65475] 4.0.21 -> 4.2 Upgrade issue, mongos adding limit geoNear queries, resulting in errors Created: 12/Apr/22 Updated: 17/May/22 Resolved: 17/May/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Rinat N/A | Assignee: | Chris Kelly |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: |
|
||||||||
| Participants: | |||||||||
| Description |
|
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
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 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:
Thanks, Rinat |
| Comments |
| Comment by Chris Kelly [ 17/May/22 ] |
|
Hi Rinat, We haven’t heard back from you for some time, so I’m going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket. Regards, |
| Comment by Chris Kelly [ 09/May/22 ] |
|
Hi Rinat, We still need additional information to diagnose the problem. If this is still an issue for you, would you please help with the following:
Regards,
|
| Comment by Chris Kelly [ 21/Apr/22 ] |
|
Hi Rinat,
I attempted to replicate your issue on a cluster with multiple shards, each with 3 nodes (PSS).
When using MongoDB 4.2.19 on config and all mongods (but not mongos), connecting to mongos (on 4.0.21) and running the query you mentioned doesn't produce the error on my end, which is odd. I also attempted this while only a subset of the mongod nodes were upgraded as well. -> upgade config server to 4.2.19 (from 4.0.21)
When doing this, and executing your query from the mongos CLI, I do not see the error with FCV still set to 4.0 on all shards. If you attempt to set FCV to 4.2 at this stage, mongos will fail due to not being able to communicate with the newer 4.2 binaries until you either set FCV back to 4.0 or upgrade mongos to 4.2. I used m (GitHub Link) to acquire the additional versions, and used the new database version binaries when restarting config/mongods (starting with secondaries, stepping down the primaries and then upgrading them, then the config server) I am using sample data from https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/ and attempted the sample queries there as well as the query you provided (on that sample data) with no issues. I generated hundreds of sample data records with the same shape of that sample data as well with no issue. I do, however, trigger the error if I specify limit as a parameter in the query manually (in the configuration mentioned above). Specifying limit at all will cause it to complain, even if set to null at this stage. I do not observe the default limit being set otherwise. In order to look into this any further, I would need to corroborate reproducing the problem with you some more. Could you:
Regards, Christopher |