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

IndexBuildInterceptor does not faithfully preserve multikey when a document generates no keys

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.0-rc3, 4.3.1
    • Component/s: Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Sprint:
      Storage NYC 2019-02-25, Storage NYC 2019-05-20, Execution Team 2019-06-03, Execution Team 2019-06-17
    • Linked BF Score:
      57
    • Story Points:
      8

      Description

      IndexBuildInterceptor makes an incorrect assumption that a document must generate keys to be considered multikey.

      In particular, sparse compound indexes may not generate keys, but will consider a document to be multikey[1]. MongoDB's validation code is strict and will compare an index's multikey to the multikey output of every document.

      [1] Consider the index {a: 1, b: "2dsphere"} (2dsphere makes an index "auto-sparse"). Consider the document {_id: 1, a: [1,2]}. Because b is omitted, the sparse-ness will result in no index keys being generated. However, because a is an array, that field of the compound index will be considered to be multikey.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: