[SERVER-11324] Create unique index on colleciton with hashed sharding key Created: 23/Oct/13 Updated: 11/Jul/16 Resolved: 14/Nov/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | 2.4.6 |
| Fix Version/s: | 2.5.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Steffen | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 12.04.x LTS |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | create a collection with index
shard collection with with key
drop index
try to recreate index
|
||||||||
| Participants: | |||||||||
| Description |
|
We want to creat a compound index in a sharded collection with a hashed sharding key. The non hashed shard key is a prefix of the compound index. If we create the index before we shard the collection, mongodb does not complain about the index.
|
| Comments |
| Comment by Scott Hernandez (Inactive) [ 28/Mar/14 ] |
|
No, this has not been back-ported to 2.4.x. This fix will be included in the upcoming 2.6 (stable) release. |
| Comment by James Blackburn [ 28/Mar/14 ] |
|
Is this fixed in any version of 2.4.x? |
| Comment by Githook User [ 14/Nov/13 ] |
|
Author: {u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Githook User [ 14/Nov/13 ] |
|
Author: {u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Scott Hernandez (Inactive) [ 23/Oct/13 ] |
|
Steffen, I've added a test showing the current behavior and the inconsistent errors depending on if you create the unique index before or after sharding the collection. Sorry for missing that detail in the reproduction. |
| Comment by Eliot Horowitz (Inactive) [ 23/Oct/13 ] |
|
There is at least one issue here that it didn't complain the other way. |
| Comment by Scott Hernandez (Inactive) [ 23/Oct/13 ] |
|
This is expected behavior based on the sharding system design and restrictions. Here are the related docs which offer more information and workarounds: |