[SERVER-9027] Using DBRef as shard key not working anymore in 2.2.0+ Created: 20/Mar/13 Updated: 11/Jul/16 Resolved: 22/Mar/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.2.0, 2.2.3, 2.4.0 |
| Fix Version/s: | 2.2.4, 2.4.2, 2.5.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Thomas Rueckstiess | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
|
Prior to 2.2.0, it was possible to use a DBRef as shardkey. Since 2.2.0 and above, this is no longer possible. Inserts and updates fail, complaining that the shardkey has not been fully specified. Steps to reproduce (run on sharded environment from mongos):
This worked in 2.0.8 but is failing in 2.2.0+ with this error:
This is particularly problematic for users/customers upgrading from 2.0.x that were using a DBRef as their shard key and can't insert any data anymore. For the updates, there is a work-around in using the _id field instead of the DBRef for the query. But for inserts, this is not possible. |
| Comments |
| Comment by auto [ 28/Mar/13 ] |
|
Author: {u'date': u'2013-03-22T17:22:42Z', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by auto [ 28/Mar/13 ] |
|
Author: {u'date': u'2013-03-22T17:22:42Z', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Terence Tung [ 27/Mar/13 ] |
|
hi Scott, do you think you have the ETA for the 2.2.4 release by now? thanks! |
| Comment by Scott Hernandez (Inactive) [ 25/Mar/13 ] |
|
We have not set a new release date for 2.2.4 yet (RC has to come out first – watch here https://jira.mongodb.org/browse/SERVER/fixforversion/12313) since it was pushed back a bit, but this fix should be committed on that branch in the next day (so the nightly RC builds will have it tomorrow night), and the release will follow shortly there after. |
| Comment by Terence Tung [ 25/Mar/13 ] |
|
hi Scott, any idea when will this fix be available in 2.2.4? thanks! |
| Comment by auto [ 22/Mar/13 ] |
|
Author: {u'date': u'2013-03-22T17:22:42Z', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Scott Hernandez (Inactive) [ 21/Mar/13 ] |
|
We are working on a fix, and backports, for this. |
| Comment by Terence Tung [ 21/Mar/13 ] |
|
hi Randolph and Scott, what is the plan for this bug? would there be a patch for 2.2 or 2.4 to fix this issue? because this bug is blocking us from upgrading our mongodb from 2.0.8 to anything above. thanks, |
| Comment by Scott Hernandez (Inactive) [ 20/Mar/13 ] |
|
Extended json should never be used in bson documents, or make it to the server. It is there for tools to convert from json -> bson docs to keep type information which can't be represented native json. Except for DBRef all "$" prefixed field names are illegal, so that would be another bug if extended json got into bson docs on the server. |
| Comment by Randolph Tan [ 20/Mar/13 ] |
|
Note: The problem is not limited to DBRef but also other extended json notation as well. |