<!-- llms-explorer concept facts · https://llms-explorer.com/tree/primary-driven-index-builds-and-write-rate-throttles/ · pack 2026-10-30 · ~1700 tokens -->

# Primary-driven index builds and write-rate throttles

> Source-anchored research for Primary-driven index builds and write-rate throttles. Run status: COMPLETED.

Parent: [Index build resource limits (maxNumActiveUserIndexBuilds, disk space)](https://llms-explorer.com/tree/index-build-resource-limits-maxnumactiveuserindexbuilds-disk-space/) · 4 facets · 16 facts · page: https://llms-explorer.com/tree/primary-driven-index-builds-and-write-rate-throttles/

## How it works

- SERVER-132661 specifies a separate bulk-load write-rate throttle because scan and load have different write profiles. It charges bytes at committed batch boundaries and places sleeping outside the WriteUnitOfWork, with locks released. (low confidence) (verified as of 2026-08-20) — [source](https://jira.mongodb.org/browse/SERVER-132661)

## Problems, failure modes and limitations

- The scan throttle ticket lists fix versions 9.1.0-rc0 and 9.1.0-rc1024 and carries auto-reverted; the related revert ticket is closed as Gone away. The bulk-load ticket lists 9.1.0-rc0. Ticket metadata alone cannot prove which released binaries contain effective throttles. (low confidence) (verified as of 2026-09-22) — [source](https://jira.mongodb.org/browse/SERVER-132553)
- Mydbops' December 2022 article presents the MongoDB 4.2 hybrid build model and calls it the only index-build type. That historical description cannot establish present primary-driven behavior or parameter availability; use the current vendor design and code for those claims. (medium confidence) (verified as of 2026-10-30) — [source](https://www.mydbops.com/blog/mongodb-index-type-and-properties-series-2)

## Comparisons and alternatives

- Primary-driven sorted-key spills use replicated storage-engine tables rather than the local unreplicated temporary files used by two-phase builds. (low confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- SERVER-132553 targets bytes written by scan-phase sorter spills and spill merges on disaggregated storage clusters, rather than documents read. Its earlier read-rate POC never merged. The ticket scopes throttling to replicated container writes and excludes foreground builds and file-based spilling. (medium confidence) (verified as of 2026-09-22) — [source](https://jira.mongodb.org/browse/SERVER-132553)
- SERVER-132662 remains an unresolved measurement/default-selection task in its August 4 record. It requests foreground-throughput versus build-duration curves, defaults or disabled-by-default guidance, and comparison against ASC; a duration within 1.5 times ASC is a target, not a measured result. (low confidence) (verified as of 2026-08-04) — [source](https://jira.mongodb.org/browse/SERVER-132662)
- Current master declares primaryDrivenIndexBuildScanPhaseContainerWriteMBperSec and primaryDrivenIndexBuildBulkLoadPhaseContainerWriteMBperSec as independent nonnegative integer limits, settable at startup and runtime. Both default to 0, disabling throttling, and apply across the whole build rather than separately per index. (medium confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/primary_driven_index_build_knobs.idl)

## Facts and statements

- The development README describes primary-driven builds as primary-only index construction: secondaries apply explicitly replicated internal ci/cd writes. Start and commit/abort markers remain, but secondary-readiness commit quorum does not apply. (low confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- The development README supports resume on step-up after failover or primary restart using persisted scan/load/drain state; a failed resume aborts the build. SERVER-136189 explicitly calls old non-resumability test exclusions incorrect. These records do not establish availability in every released deployment. (low confidence) (verified as of 2026-10-16) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- The scan and bulk-load tickets specify DataThrottle byte budgeting. The scan ticket describes a live-settable MB/sec supplier and zero as disabled. These are implementation requirements; they do not establish supported production parameter names or effective deployed defaults. (low confidence) (verified as of 2026-09-22) — [source](https://jira.mongodb.org/browse/SERVER-132553)
- For baseline hybrid builds, Percona's instrumented walkthrough and Mydbops' engineering explanation describe exclusive collection locks at start/end and interleaved reads/writes during the main build. This historical baseline does not validate primary-driven throttle behavior. (medium confidence) — [source](https://www.percona.com/blog/stages-of-index-build-in-mongodb/)
- Primary-driven builds support resuming on step-up after failover or primary restart. The current README describes support across all phases and build configurations; SERVER-136189 explicitly identifies older non-resumability test exclusions as obsolete. (medium confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- Resume metadata tracks build phase and per-index sorter ranges and internal-table identifiers. Scan progress persists on sorter spills; load progress persists periodically; drain entry persists once. If resume fails, the primary-driven build aborts. (low confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- Replicating primary-driven side writes increases oplog work: a document write with n indexes under construction produces n+1 operations that must apply atomically. (low confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- The bulk-load throttle limits writes from the sorter into the index table. The design charges bytes at batch/yield boundaries outside the write unit of work; master describes the maximum unthrottled burst in terms of internalIndexBuildBulkLoadYieldIterations keys. (medium confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/primary_driven_index_build_knobs.idl)
- Percona's March 2024 worked example records collection scanning, loading keys from the external sorter, and a side-writes table. These observed stages provide background for the scan/load distinction, but do not independently establish the newer primary-driven throttle behavior. (medium confidence) — [source](https://www.percona.com/blog/stages-of-index-build-in-mongodb/)
