[SERVER-29334] Cannot write shard chunks documents with _id fields containing values with dotted field names, e.g. { _id: { a.b: 10 } } Created: 23/May/17 Updated: 30/Oct/23 Resolved: 02/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Dianna Hohensee (Inactive) |
| Resolution: | Fixed | 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 | ||||||||||||||||||||||||||||||||||||||||
| Sprint: | Sharding 2017-05-29, Sharding 2017-06-19 | ||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
_id fields are not allowed to have values containing dotted field names, like we're currently doing for chunk metadata collections on the shard, e.g.
Can see the problem if you follow this code here, here and here. This check doesn't appear to be done on non _id fields, so it's fine when we do it on the config server like this
_id checks on insert seem to have been introduced in v3.0 in this commit ( The dotted field check originated in 1.7 via this commit Dotted field names must be allowed on insert for shard keys. It is an inconsistency that we check for dotted field names on _id, but no other fields. |
| Comments |
| Comment by Githook User [ 02/Jun/17 ] |
|
Author: {u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}Message: |
| Comment by Dianna Hohensee (Inactive) [ 24/May/17 ] |
|
The proposed solution is to remove this code that does the dotted field checks in BSONObj::_okForStorage. After Added to ops/insert.cpp to check for '$'' fields, https://github.com/mongodb/mongo/commit/34d899304d971942e6ce4743489495d11a4d48c1 Not intended to check for dotted field names. Unsure whether we want to keep a.$.b checks somehow – removing dotted field name checks lets this format of field name with '$' slip by. Introduced to shard_key_pattern.cpp in this commit https://github.com/mongodb/mongo/commit/a67ea3ac0c570cc738d43494079e2bc284aa5071#diff-de3717d584ea2ec74a8014339593ce2fR54 to fix '$' problems. Doesn't seem to need the dotted field check, explicitly, so seems incidental. |