[SERVER-6992] "collection already exists" error misses code Created: 10/Sep/12 Updated: 05/Apr/17 Resolved: 26/Oct/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Gustavo Niemeyer | Assignee: | Kyle Suarez |
| Resolution: | Done | Votes: | 1 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
Creating a duplicate collection is a common error cases that needs a comparison to differentiate real errors from expected behavior, and unfortunately it misses a code at the moment: [LOG] 37.79905 Socket 0xf84014d540 to localhost:54424: received document: bson.M {"ok":0, "errmsg":"collection already exists"} |
| Comments |
| Comment by Kyle Suarez [ 26/Oct/16 ] | |||||||||
|
I'm resolving this as Gone Away since in all instances we do include an error code for "collection already exists": either 17399 or 48, depending on the exact path taken in the code. | |||||||||
| Comment by Ian Whalen (Inactive) [ 30/Sep/16 ] | |||||||||
|
this can probably be resolved once someone checks to confirm that we're now including an error code. | |||||||||
| Comment by Gustavo Niemeyer [ 18/Sep/12 ] | |||||||||
|
Consistency is great, but it's currently sitting at the wrong side. As a data point, this is part of the stock documentation for the Node driver:
In other words, stock documentation is suggesting skipping all errors and simply assume they know what's going on. Another data point: this is the current create_collection routine of the Ruby driver:
In good faith, it's attempting to handle the situation internally to clean up the API. Unfortunately, it introduces a race condition in the code that will cause the user logic to explode if the collection happens to be created between the test and the action. The root cause for these is lack of information about the error, which forces people to either test for error strings or ignore the error entirely assuming they know what it is, and both of these examples come from experienced MongoDB people. People in the wild are not doing much better. | |||||||||
| Comment by Eliot Horowitz (Inactive) [ 18/Sep/12 ] | |||||||||
|
No normal command failures have error codes. |