[SERVER-20463] Error Code for database not found has changed for listIndexes Created: 17/Sep/15 Updated: 07/Oct/15 Resolved: 22/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.1.7 |
| Fix Version/s: | 3.1.9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Kaloian Manassiev |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Sharding A (10/09/15) | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
When running the listIndexes command on a database that does not exist, the error code has changed in a sharded system. Not only that, the error code is different between a mongos and a mongod. Drivers are relying on this error code to provide an empty list to a user rather than an exception as is specified. 3.0.5
Latest
|
| Comments |
| Comment by Kaloian Manassiev [ 22/Sep/15 ] |
|
As part of this change we have gotten rid of error code 60 (DatabaseNotFound) and now we always return error code 26 (NamespaceNotFound) instead. I couldn't find any parts of the documentation, which reference 60 specifically, so there might not be need for documentation changes, but I selected 'Driver Changes' as Maybe in order to bring attention. |
| Comment by Githook User [ 22/Sep/15 ] |
|
Author: {u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}Message: This change replaces all usages of error code 60 (DatabaseNotFound) with |
| Comment by Kaloian Manassiev [ 18/Sep/15 ] |
|
craiggwilson/behackett - error code 60 is DatabaseNotFound and error code 26 is NamespaceNotFound. In 3.2 we fixed a sharding bug, which was always implicitly creating databases (even on reads) so now we actually get a more specific error. I understand this breaks backwards compatibility though. In order to simplify the decision of "what do I return if I can't find the database or collection", we are proposing that we get rid of the DatabaseNotFound (code 60) altogether and always just use NamespaceNotFound. This would also take care of this bug. The only externally visible manifestations for this change would be the explain of the findAndModify command, which will start returning code 26 if the database does not exist. |
| Comment by Bernie Hackett [ 17/Sep/15 ] |
|
Well, 60 is also defined there, so there's that... |
| Comment by Bernie Hackett [ 17/Sep/15 ] |
|
Indeed. NamespaceNotFound is defined here: https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.err. The server should be using the error codes defined there. |