<!-- llms-explorer concept facts · https://llms-explorer.com/tree/primary-driven-index-builds/ · pack 2026-10-23 · ~914 tokens -->

# Primary-driven index builds

> Source-anchored research for Primary-driven index builds. Run status: COMPLETED.

Parent: [Resumable index builds](https://llms-explorer.com/tree/resumable-index-builds/) · 3 facets · 9 facts · page: https://llms-explorer.com/tree/primary-driven-index-builds/

## Structure and components

- The implementation builds indexes on the primary and replicates internal writes using ci/cd oplog entries; secondaries apply those writes. Start and commit/abort oplog markers remain part of the protocol. (high confidence) (verified as of 2026-10-20) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/index_builds/README.md)

## Problems, failure modes and limitations

- The reviewed createIndexes implementation disables secondary-readiness commit quorum for primary-driven builds: an explicit commitQuorum produces a warning and the command uses the primary self-vote setting. This concerns build coordination, not a replacement for write concern. (medium confidence) (verified as of 2026-10-20) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/index_builds/README.md)
- [redacted] records a secondary validation failure after building an index over an array-valued field: Index is not multikey but document has multikey data. The ticket lists a fix in 8.3.0-rc0. (low confidence) (verified as of 2026-04-14) — [source](https://example.test/withheld-reference)

## Facts and statements

- The README describes sorted-key spills into replicated storage-engine tables, replacing the unreplicated temporary spill files used by two-phase builds. (low confidence) (verified as of 2026-10-20) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/index_builds/README.md)
- The development implementation supports resume after failover or primary restart. An October 2026 ticket explicitly identifies lingering test exclusions claiming non-resumability as stale. This does not establish availability in any deployed release. (high confidence) (verified as of 2026-10-16) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/index_builds/README.md)
- SERVER-127943 reports that resuming a multikey wildcard build at the beginning of bulk load could crash a secondary with WT_DUPLICATE_KEY. Missing restoration of the metadata-key deduplication flag caused duplicate container inserts. The ticket lists a fix in 9.0.0-rc0; it does not confirm all requested backports. (low confidence) (verified as of 2026-10-20) — [source](https://jira.mongodb.org/browse/SERVER-127943)
- [redacted] warns that internal commit-quorum pathways can still produce confusing logs despite disabled quorum semantics. It also states that writes still need to be blocked during commit. (low confidence) (verified as of 2026-04-30) — [source](https://example.test/withheld-reference)
- Resume state records the build phase and per-index sorter ranges and table identifiers. Step-up attempts recovery from that state; if recovery fails, the build aborts. Resumability therefore does not guarantee every interrupted build completes. (low confidence) (verified as of 2026-10-20) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/index_builds/README.md)
- The coordinator attaches interceptors for resumable builds before onStepUp returns and the node accepts writes. Its comment explains that an earlier write would otherwise be invisible to the resumed build. (low confidence) (verified as of 2026-10-20) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/index_builds/index_builds_coordinator.cpp)
