[SERVER-5365] range query on shard key incorrectly sends query to extra shard(s) Created: 22/Mar/12 Updated: 10/Dec/19 Resolved: 02/May/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Y. Wayne Huang | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | query, sharding | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ubuntu 10.04 lts, x86_64 |
||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
printShardingStatus(true) says a certain range of shard key ids fall within a single shard: ... { "my_id" : 13165 }-->> { "my_id" : 13200 }on : shard4 { "t" : 68000, "i" : 0 } { "my_id" : 13200 }-->> { "my_id" : 13540 }on : shard3 { "t" : 69000, "i" : 0 }... i am taking this to mean [13165, 13200) exists on shard4, while [13200, 13540) exist on shard3 based on: db.coll.find( {my_id:13200}).explain() } therefore i would expect the range query: {"my_id":{"$gte":13165,"$lt":13200}} to be sent only to shard4, however that is not the case: db.coll.find({my_id:{'$gte':13165,'$lt':13200}}).explain() } } it should go only to shard4 no? |