DiskSpaceMonitor and low-disk index build abort (7.1+)
Parent: Index build resource limits (maxNumActiveUserIndexBuilds, disk space) · Published reference · snapshot 2026-10-31
↓ Facts as markdownall context files
Source-anchored research for DiskSpaceMonitor and low-disk index build abort (7.1+). Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
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]
- 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]
- 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]
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]
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]
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]
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]
- 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]
- The low-disk threshold does not stop a member’s index build after that member has already voted to commit. (high confidence) [source]
- 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]
- 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]
- 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]
- 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]
Children
- No children recorded.