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 } }

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.9
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2017-05-29, Sharding 2017-06-19
    • 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.

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dianna.hohensee Dianna Hohensee
              Reporter:
              dianna.hohensee Dianna Hohensee
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: