[SERVER-14302] Equality queries on _id with projection may return no results on sharded collections Created: 19/Jun/14 Updated: 11/Jul/16 Resolved: 19/Jun/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Sharding |
| Affects Version/s: | 2.6.2 |
| Fix Version/s: | 2.6.3, 2.7.3 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | David Hows | Assignee: | J Rassi |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Backport Completed: | |||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
Issue Status as of Jun 19, 2014 ISSUE SUMMARY Example: The following query includes an equality predicate on _id and contains a projection returns only the _id and bar fields. Suppose coll is a sharded collection with shard key {foo:1}. Since foo is not in the resulting document, the query is affected by this bug and won't return any results.
USER IMPACT WORKAROUNDS
AFFECTED VERSIONS FIX VERSION RESOLUTION DETAILS Original descriptionSharded queries that include an equality predicate on _id and a projection that removes the shard key will return no results. The cause of this issue is a regression introduced in 2.6.2 ( To work around this issue, add a hint of {_id: 1} to any affected query. An explicit hint disables use of the IDHackRunner. |
| Comments |
| Comment by Githook User [ 19/Jun/14 ] |
|
Author: {u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}Message: (backport of 6fe6dee814326ac41f8d626c26bf32763ce73d71) |
| Comment by Githook User [ 19/Jun/14 ] |
|
Author: {u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}Message: (backport of 6fe6dee814326ac41f8d626c26bf32763ce73d71) |
| Comment by Githook User [ 19/Jun/14 ] |
|
Author: {u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}Message: |
| Comment by Daniel Pasette (Inactive) [ 19/Jun/14 ] |
|
Note, this issue does not exhibit with hashed shard keys. |
| Comment by David Hows [ 19/Jun/14 ] |
|
Workaround is to .hint({_id:1}) |