[CSHARP-2152] Create index returns wrong result Created: 23/Jan/18 Updated: 27/Oct/23 Resolved: 07/Feb/18 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Command Operations, Error Handling, Operations |
| Affects Version/s: | 2.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | daniel moqvist | Assignee: | Vincent Kam (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | Indexing | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Issue Links: |
|
||||||||
| Server Compat: | 4.1 | ||||||||
| Description |
|
When creating an index that already exists, the IndexManager CreateOne method returns wrong result. Example:
The second row of index creation should return Index1 or at least notify me that index was not created since it already exists. When doing the same direct in mongo shell I get notified that the index was not created.
|
| Comments |
| Comment by daniel moqvist [ 08/Feb/18 ] |
|
Hi Vincent, Kind regard, |
| Comment by Vincent Kam (Inactive) [ 07/Feb/18 ] |
|
Hello Daniel, Thank you for your submission! It is somewhat of an interesting problem. After some investigation, as Robert noted, this unfortunately appears to be a server bug. It is also not feasible to return the existing index name because the server is not returning that information, and it would be undesirable to require an additional round trip to the server to verify whether the existing index has the same name or not. May I ask what you're using the index name for? Would index hinting via the key pattern work instead of supplying an index name? For now though, we've notified the server team, but until the bug is fixed, the driver can't do much and is working as designed (since "ok: 1" was returned). I can only offer the "index hinting" workaround as a potential solution, my apologies. Kind regards, |
| Comment by Robert Stam [ 06/Feb/18 ] |
|
This looks like a server bug. When creating the second index (with a different name) the server is reporting that the index already exists, even though the existing index has a different name. See: |