<!-- llms-explorer concept facts · https://llms-explorer.com/tree/mongodb-rolling-index-builds/ · pack 2026-10-30 · ~1127 tokens -->

# MongoDB rolling index builds

> Source-anchored research for MongoDB rolling index builds. Run status: COMPLETED.

Parent: [Resumable index builds](https://llms-explorer.com/tree/resumable-index-builds/) · 3 facets · 12 facts · page: https://llms-explorer.com/tree/mongodb-rolling-index-builds/

## How it works

- MongoDB warns against running rolling and replicated index build processes concurrently because this can cause broken builds and crash loops. (medium confidence) — [source](https://www.mongodb.com/docs/manual/core/rolling-index-builds.md)
- SERVER-71769 records historical Atlas cases where secondaries already had an index absent from the primary, suspected to follow interrupted rolling builds; retrying on the primary could stall when those secondaries skipped commit-quorum voting. This issue report is historical evidence, not proof that every current release has the same behavior. (low confidence) — [source](https://jira.mongodb.org/browse/SERVER-71769)
- Percona demonstrated an Operator-specific maintenance workflow using /data/db/sleep-forever to prevent normal mongod restart, followed by a manual standalone build; removing the marker after shutdown restores normal pod behavior. This is a published implementation example, not a universal Kubernetes mechanism. (low confidence) (verified as of 2025-07-28) — [source](https://www.percona.com/blog/how-to-perform-rolling-index-builds-with-percona-operator-for-mongodb/)

## Problems, failure modes and limitations

- Creating a unique index with the manual rolling procedure requires stopping all writes to that collection throughout the procedure; if writes cannot stop, MongoDB instructs users to use the ordinary createIndex route instead. (low confidence) — [source](https://www.mongodb.com/docs/manual/tutorial/build-indexes-on-replica-sets.md)

## Facts and statements

- A rolling index build builds on one member at a time as a standalone, starting with secondaries; after replication catches up, repeat for other members and step down the original primary before building there. (high confidence) — [source](https://www.mongodb.com/docs/manual/core/rolling-index-builds.md)
- Rolling builds can reduce index-construction resource contention on serving members, but require at least one election, lower cluster resilience, and increase total build duration; they do not guarantee zero disruption. (medium confidence) — [source](https://www.mongodb.com/docs/manual/core/rolling-index-builds.md)
- The replica-set rolling procedure requires an oplog window long enough to cover the offline index build and allow catch-up; wait for the member to catch up before taking another member through the procedure. (high confidence) — [source](https://www.mongodb.com/docs/manual/tutorial/build-indexes-on-replica-sets.md)
- If a standalone mongod shuts down during an index build, the build job and its progress are lost. Restarting mongod does not restart that build; createIndex must be issued again. Applied to rolling construction, this means an interrupted local build is not checkpoint-resumable. (medium confidence) (verified as of 2026-10-30) — [source](https://www.mongodb.com/docs/manual/core/index-creation.md)
- Restarting a replica-set member as standalone does not resume its previously interrupted replicated index build: MongoDB documents that the build remains paused until manually dropped. Switching to standalone is therefore not a recovery procedure for that in-flight build. (low confidence) (verified as of 2026-10-30) — [source](https://www.mongodb.com/docs/manual/core/index-creation.md)
- JAVA-6023 explains that the Java driver's 'Expecting replica set member, but found a STANDALONE' log during a rolling build can reflect the expected temporary topology change; that message itself does not throw an exception. (low confidence) — [source](https://jira.mongodb.org/browse/JAVA-6023)
- The official replica-set procedure hides the selected secondary with priority zero, starts it without replSetName on a different port, builds the index, restores its replica-set configuration, then restores visibility and its original priority after catch-up. (low confidence) — [source](https://www.mongodb.com/docs/manual/tutorial/build-indexes-on-replica-sets.md)
- After processing every member, checking getIndexes on each member verifies that the rolling procedure installed the intended index everywhere. (low confidence) — [source](https://oneuptime.com/blog/post/2026-03-31-mongodb-rolling-index-builds/view)
