<!-- llms-explorer concept facts · https://llms-explorer.com/tree/diskspacemonitor-and-low-disk-index-build-abort-7-1/ · pack 2026-10-31 · ~1302 tokens -->

# DiskSpaceMonitor and low-disk index build abort (7.1+)

> Source-anchored research for DiskSpaceMonitor and low-disk index build abort (7.1+). Run status: COMPLETED.

Parent: [Index build resource limits (maxNumActiveUserIndexBuilds, disk space)](https://llms-explorer.com/tree/index-build-resource-limits-maxnumactiveuserindexbuilds-disk-space/) · 5 facets · 13 facts · page: https://llms-explorer.com/tree/diskspacemonitor-and-low-disk-index-build-abort-7-1/

## How it works

- MongoDB introduced automatic low-disk index-build cancellation in 7.1; the index-build design README says it applies on primary and secondary members and that a primary also refuses to start a build when free space is low. (high confidence) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/index_builds/README.md)
- The storage design README describes DiskSpaceMonitor as a ServiceContext decoration started during initialization; it checks free space in the database path every second and invokes registered actions when available bytes are less than or equal to the action threshold. (low confidence) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/storage/README.md)
- In the v8.0 implementation, DiskSpaceMonitor captures dbPath, schedules a one-second periodic job, measures available space there, and executes registered actions when availableBytes is less than or equal to an action threshold. (high confidence) — [source](https://github.com/mongodb/mongo/blob/v8.0/src/mongo/db/storage/disk_space_monitor.cpp)

## Measurements and reference values

- MongoDB 8.0 documents indexBuildMinAvailableDiskSpaceMB as a mongod-only parameter introduced in 7.1, with a default of 500 MB. It accepts 0 through 8 TB; 0 disables the minimum-space requirement. (low confidence) (verified as of 2026-10-27) — [source](https://www.mongodb.com/docs/v8.0/reference/parameters/)

## Problems, failure modes and limitations

- OneUptime’s March 31, 2026 troubleshooting article recommends checking the MongoDB data filesystem with df -h, freeing or adding storage, and retrying an index build after a disk-space failure; it does not describe DiskSpaceMonitor or establish 7.1-specific behavior. (low confidence) — [source](https://oneuptime.com/blog/post/2026-03-31-mongodb-fix-mongoerror-index-build-failed/view)

## Comparisons and alternatives

- The minimum-space parameter is an available-space floor rather than a per-build disk budget or peak-space estimate: the documentation warns that setting it too high can unnecessarily prevent builds, while the monitor compares current free bytes against a fixed action threshold. This distinction is an inference from those mechanisms. (medium confidence) — [source](https://www.mongodb.com/docs/v8.0/reference/parameters/)

## Facts and statements

- indexBuildMinAvailableDiskSpaceMB can be changed at runtime with db.adminCommand({setParameter:1,indexBuildMinAvailableDiskSpaceMB:650}) or at startup with mongod --setParameter indexBuildMinAvailableDiskSpaceMB=650; an excessively high floor can unnecessarily block index creation. (low confidence) — [source](https://www.mongodb.com/docs/v8.0/reference/parameters/)
- The storage design README scopes the IndexBuildsCoordinator low-disk kill action to configurations where neither directoryPerDb nor directoryForIndexes is enabled; its general free-space monitoring description does not promise equivalent index-build protection for other directory layouts. (low confidence) (verified as of 2026-10-27) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/storage/README.md)
- The low-disk threshold does not stop a member’s index build after that member has already voted to commit. (high confidence) — [source](https://www.mongodb.com/docs/v8.0/core/index-creation/)
- Tencent Cloud lists automatic stopping below indexBuildMinAvailableDiskSpaceMB among its MongoDB 8.0 index-build improvements; this is a product feature description and does not establish that the feature first appeared upstream in 8.0. (low confidence) (verified as of 2026-10-31) — [source](https://main.qcloudimg.com/raw/document/product/pdf/240_620_cn.pdf)
- Manning’s generated concept explainer for MongoDB 8.0 in Action, Third Edition describes low-disk automatic stopping in its MongoDB 7.1 comparison table. (low confidence) — [source](https://livebook.manning.com/learn/concepts/index-build--technique/mongodb-in-action-third-edition)
- SERVER-77629 records a historical race in which DiskSpaceMonitor read storageGlobalParams.dbPath while file-copy-based initial sync could change it; the issue reports fixes in 7.1.0-rc0 and 7.0.0-rc3, so the monitor itself should not be assumed to have first existed in 7.1. (low confidence) (verified as of 2026-09-21) — [source](https://jira.mongodb.org/browse/SERVER-77629)
- The v8.0 DiskSpaceMonitor does not start if the storage engine uses directoryPerDB or directoryForIndexes; the master storage design README likewise limits the index-build kill action to configurations without those directory options. (high confidence) (verified as of 2026-10-30) — [source](https://github.com/mongodb/mongo/blob/v8.0/src/mongo/db/storage/disk_space_monitor.cpp)
