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

Cloner::copyIndexes() should generate createIndexes oplog entry (single phase index build) for building indexes on empty collection.

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.0-rc2, 4.7.0
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.4
    • Sprint:
      Execution Team 2020-04-20

      Description

      This Cloner::copyIndexes() is called either during rollback via refetch or by sharding specific commands "_shardsvrCloneCatalogData" & "_cloneCatalogData".

      If this Cloner::copyIndexes() is called on primary for creating indexes on a non-empty collection, this can cause secondaries to block replication. But, it seems, if the node is primary, then we build indexes only on empty collections. To make this reasoning more obvious to the readers, we should make sure that if writes are replicated
      1) Node should be in primary
      2) Indexes that being built should be only on empty collection (can use IndexBuildsCoordinator::createIndexesOnEmptyCollection()) and they generate createIndexes oplog entry, making it more like a single phase.

      If writes are not replicated, the collection may not be empty. This can happen only during rollback via refetch and we don't generate any oplog entries.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              suganthi.mani Suganthi Mani
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: