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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.2.0-rc3, 4.3.1
    • Storage
    • Fully Compatible
    • ALL
    • v4.2
    • Storage NYC 2019-02-25, Storage NYC 2019-05-20, Execution Team 2019-06-03, Execution Team 2019-06-17
    • 57
    • 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

              benety.goh@mongodb.com Benety Goh
              daniel.gottlieb@mongodb.com Daniel Gottlieb
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: