<!-- llms-explorer concept facts · https://llms-explorer.com/tree/index-side-write-drain-moving-denominator-progress-in-r8-2-0/ · pack 2026-11-02 · ~843 tokens -->

# Index side-write drain moving-denominator progress in r8.2.0

> Source-anchored research for Index side-write drain moving-denominator progress in r8.2.0. Run status: COMPLETED.

Parent: [serverStatus indexBuilds metrics and index build observability](https://llms-explorer.com/tree/serverstatus-indexbuilds-metrics-and-index-build-observability/) · 3 facets · 4 facts · page: https://llms-explorer.com/tree/index-side-write-drain-moving-denominator-progress-in-r8-2-0/

## Problems, failure modes and limitations

- After committing a nonempty batch in r8.2.0, the drain calls progress.hit(batchSize), increments _numApplied, optionally yields when DrainYieldPolicy::kYield applies, and then calls setTotalWhileRunning(_sideWritesCounter->loadRelaxed() - appliedAtStart). Thus the total is refreshed after batch progress and any yield; the code explicitly attributes the refresh to writes arriving during a batch and warns that the meter cannot be completely accurate. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/r8.2.0/src/mongo/db/index_builds/index_build_interceptor.cpp)

## Comparisons and alternatives

- In r8.2.0, IndexBuildInterceptor::drainWritesIntoIndex captures const int64_t appliedAtStart = _numApplied at entry and resets its CurOp progress meter total to _sideWritesCounter->load() - appliedAtStart. This subtracts records applied before this invocation, rather than continually subtracting the current _numApplied from the denominator. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/r8.2.0/src/mongo/db/index_builds/index_build_interceptor.cpp)
- The r8.2.0 drain meter counts side-table records for key operations rather than collection documents: batchSize advances per side-table record, and _finishSideWrite adds toInsert.size() to _sideWritesCounter with an onRollback subtraction. The release README illustrates why document-write counts differ: changing one indexed value records both deletion of the old key and insertion of the new key. The counter can also decrease on rollback; the refreshed total is not invariably increasing. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/r8.2.0/src/mongo/db/index_builds/index_build_interceptor.cpp) · [also](https://github.com/mongodb/mongo/blob/r8.2.0/src/mongo/db/index_builds/README.md)

## Facts and statements

- Inference from the refreshed denominator: arrivals can lower the displayed completion fraction despite applied work increasing. The pinned README permits new keys during IX-lock draining; the 8.0 manual and Percona describe snapshot-bounded processing. Those snapshot limits do not establish a fixed denominator across successive drain batches or yields, or a whole-build ETA. Optional yielding abandons the snapshot and releases locks; a drain therefore must not be modeled as invariably processing one immutable snapshot. Percona provides procedural context, not release-specific corroboration of the denominator formula. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/r8.2.0/src/mongo/db/index_builds/index_build_interceptor.cpp) · [also](https://github.com/mongodb/mongo/blob/r8.2.0/src/mongo/db/index_builds/README.md) · [also](https://www.mongodb.com/docs/v8.0/core/index-creation/) · [also](https://www.percona.com/blog/stages-of-index-build-in-mongodb/)
