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

Newly-elected primaries do not wait for single-phase background index builds to complete before accepting writes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.0.0, 4.2.0
    • Fix Version/s: 4.2.9, 4.0.21
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Backport Requested:
      v4.0
    • Sprint:
      Execution Team 2020-06-29, Execution Team 2020-07-13
    • Linked BF Score:
      17

      Description

      Definition of "single-phase background builds": Index builds started on versions 4.2 and prior; in 4.4, index builds started in FCV 4.2. 

      Consider the scenario:

      • Node 1, Primary, starts and completes a single-phase background index build. It replicates a "createIndexes" oplog entry
      • Node 2, Secondary, starts the index build
      • Node 2 steps up as primary, but the index build is still incomplete

      Say a client created an index and waited for it to complete on the primary before issuing read queries. After the state transition, the client will see that the index build is no longer available for queries until the new primary completes the index build. 

      Proposed solution: on a state transition to primary, wait for all BackgroundOperations to complete like we already do for rollback.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              louis.williams Louis Williams
              Reporter:
              louis.williams Louis Williams
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: