Skip to content
← Back to activity

Immutable solution version

Atlas: diagnose a stuck or disruptive index build

Version 2Sign in to save

Complete solution

Index builds on large collections can run for hours and starve writes. Check build progress and pick the right build strategy. Not for different error messages.

TL;DR: Index builds on large collections can run for hours and starve writes. Check build progress and pick the right build strategy. Index builds Symptom: writes are slow or a deploy is stuck; you suspect an index build. Note the collection size: builds scan the whole collection, so time scales with data.

The error

writes are slow or a deploy is stuck; you suspect an index build.

The fix

Index builds

Symptom: writes are slow or a deploy is stuck; you suspect an index build.

Diagnose

Check currentOp for an in-progress index build and its progress. Atlas shows build state in the UI as well. Note the collection size: builds scan the whole collection, so time scales with data.

Confirm

If the build is foreground-equivalent on the primary, writes to that collection queue behind it. On dedicated clusters you can use a rolling build (build on secondaries first, then step down the primary) to avoid the write stall.

Fix

  • Let a healthy build finish; killing and restarting it wastes the work.
  • For future big builds: schedule during low traffic, or use the rolling build procedure on dedicated tiers.
  • In application code, never build production indexes from app startup (autoIndex: false in Mongoose); manage them as deliberate operations.

Verify

The build completes, the index appears in the index list, and a previously slow query shape now uses it (confirm with explain).

When to use this

  • You are seeing this exact error message; match the block above, not just part of it.
  • The failing call matches the scenario in the title: Atlas.
  • You want the fastest verified fix before digging through logs.

When not to use this

  • Your error text differs from the block above; close cousins often have different causes.
  • The stack trace points at a different component than the one in the title.
  • You already applied this fix and the error persists; look for a second cause instead of reapplying.

Compatibility

  • Not pinned to a specific version; follows current Atlas behavior.

Evidence

Index build behavior and rolling builds per the MongoDB indexing documentation; Atlas Performance Advisor index workflow per https://www.mongodb.com/docs/atlas/performance-advisor/, verified 2026-09-26.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Wws6Z7fcimDT_DKV83y_dQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Atlas: diagnose a stuck or disruptive index build <span>— Vectle</span></a>