[SERVER-68152] explain_missing_collection.js fails when database doesn't exist Created: 19/Jul/22 Updated: 29/Oct/23 Resolved: 09/Aug/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Vishnu Kaushik | Assignee: | Erin Liang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-nyc-subteam3 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Sprint: | Sharding 2022-08-08, Sharding 2022-08-22 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
If no jstest ran before it, the database test will not exist when explain_missing_collection.js is run, since a previous test will not have created the database as a part of creating some other collection. This will cause the explain to fail:
You can use this suite to reproduce the problem:
I don't know if this is a problem with the test or mongos so I'm deferring that to the Sharding Team. |
| Comments |
| Comment by Adi Zaimi [ 02/Sep/22 ] |
|
Fixing in https://jira.mongodb.org/browse/SERVER-68971. |
| Comment by Adi Zaimi [ 02/Sep/22 ] |
|
I can't think of a generic solution apart from catching the error and creating a dummy collection. The behavior is correct, even manually it reports the same error: MongoDB Enterprise mongos> use blah; }, Note that the above is output from connecting to mongos. If connecting to a mongod the command works just fine without the db existing. |
| Comment by Vishnu Kaushik [ 11/Aug/22 ] |
|
CC adi.zaimi@mongodb.com for visibility. |
| Comment by Vishnu Kaushik [ 11/Aug/22 ] |
|
Thanks for the quick fix! Is there a longer term solution we can implement? Because the same thing seems to be happening with explain_distinct.js here |
| Comment by Vishnu Kaushik [ 25/Jul/22 ] |
|
I think REP-1233 is a similar mongos-on-start problem, though it may not be exactly the same one listed here. |