Using removeExistingIndexes in conjunction with createIndexesOnEmptyCollection results in out of order index fields.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2019-12-16
    • 47
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There are several places in the code base that call into IndexBuildsCoordinator's static createIndexesOnEmptyCollection function to create an index, as opposed to going through the IndexBuildsCoordinator itself. To prepare the index specs for creation, these callers use IndexCatalog::removeExistingIndexes. However, these index specs result in out-of-order fields compared to index builds that use the IndexBuildsCoordinator, because the IndexCatalog::prepareSpecForCreate function, which is called via MultiIndexBlock, re-orders the fields. Even though IndexCatalog::removeExistingIndexes does call IndexCatalog::prepareSpecForCreate, the spec objects returned by prepareSpecForCreate are unused.

      The implication of this bug is the oplog entries for different index builds will have a different ordering of subfields inside the "o" field.

      Using the return result of prepareSpecForCreate in the return result of removeExistingIndexes should address the ordering inconsistency.

            Assignee:
            Maria van Keulen
            Reporter:
            Maria van Keulen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: