Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29334

Cannot write shard chunks documents with _id fields containing values with dotted field names, e.g. { _id: { a.b: 10 } }

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.9
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
    • Fully Compatible
    • ALL
    • Sharding 2017-05-29, Sharding 2017-06-19
    • 0

      _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.

      { _id: { "a.b": 10 } }

      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

      { min: { "a.b": 10 } }

      _id checks on insert seem to have been introduced in v3.0 in this commit (SERVER-12209). This is a server check. There are also more checks in the shell that prevent dotted field names, probably more generically. SERVER-12209 seems to have been in response to errors involving "$" rather than any intention to check for dotted field names.

      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.

            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            0 Vote for this issue
            5 Start watching this issue