Skip to content

feat(mongodb): set indexBuildMinAvailableDiskSpaceMB to 10 GiB#2436

Open
delthas wants to merge 1 commit into
development/2.15from
improvement/ZENKO-5295/mongo-index-build-disk-threshold
Open

feat(mongodb): set indexBuildMinAvailableDiskSpaceMB to 10 GiB#2436
delthas wants to merge 1 commit into
development/2.15from
improvement/ZENKO-5295/mongo-index-build-disk-threshold

Conversation

@delthas

@delthas delthas commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Add --setParameter indexBuildMinAvailableDiskSpaceMB=10000 (10 GiB) to the mongod startup flags of config servers and shard data servers in the rendered mongodb-sharded manifests (solution-base/build.sh).

The MongoDB default (500 MB) is far below the transient disk peak of a real lifecycle index build — spill files plus the partial index B-tree can transiently use tens of GB on a 100M-document bucket. With this parameter (7.1+ semantics; we ship MongoDB 8.0.13) raised to 10 GiB, mongod refuses to start new index builds and kills in-flight ones while the volume still has comfortable headroom, rather than at the last 500 MB.

This supersedes the Artesca installer-side implementation from scality/artesca#5228 (ARTESCA-17683): per review feedback there, this is purely MongoDB behavior and belongs in zenko-base, where every consumer of the rendered manifests benefits.

Implementation notes

  • The flag is added as a second mongodbExtraFlags list item: next to the existing rollbackTimeLimitSecs=259200 constant on configsvr, and next to the MONGODB_SHARDSERVER_EXTRA_FLAGS placeholder on shardsvr. Consumers substitute that placeholder with plain string replacement (Artesca read_manifest, CI sed), so a partial-value placeholder keeps working unchanged.
  • mongos and shard arbiters are left untouched — they host no data and build no indexes.
  • Verified by diffing the rendered deploy/mongodb-sharded-*.yaml against development/2.15: the only changes are the 59 expected MONGODB_EXTRA_FLAGS values (13 configsvr + 46 shard-data StatefulSets across the 13 topology files), e.g.:
             - name: MONGODB_EXTRA_FLAGS
-              value: "--setParameter rollbackTimeLimitSecs=259200"
+              value: "--setParameter rollbackTimeLimitSecs=259200 --setParameter indexBuildMinAvailableDiskSpaceMB=10000"

Related

  • ARTESCA-17683 / scality/artesca#5228 — superseded installer-side implementation
  • ZENKO-5286 / BB-783 — Backbeat putBucketIndexesFailed metric on the failure path
  • ZENKO-5285 — alert on index creation failures
  • ARSN-588 — functional test exercising the disk-space refusal path

Issue: ZENKO-5295

@bert-e

bert-e commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@delthas delthas requested a review from francoisferrand June 11, 2026 10:32
@bert-e

bert-e commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

mongod refuses to start new index builds and kills in-flight ones when
free disk on the data volume drops below this threshold. The default
(500 MB) only stops a runaway lifecycle index build once the volume is
nearly full, leaving almost no headroom for regular writes; raise the
threshold to 10 GiB so builds are stopped well before the disk gets
critically full.

Applied to config servers and shard data servers; mongos and arbiters
host no data and build no indexes, so they are left untouched. The flag
is appended next to the MONGODB_SHARDSERVER_EXTRA_FLAGS placeholder,
which consumers substitute with plain string replacement, so the
substitution keeps working unchanged.

Supersedes the installer-side implementation from
scality/artesca#5228 (ARTESCA-17683).

Issue: ZENKO-5295
@delthas delthas force-pushed the improvement/ZENKO-5295/mongo-index-build-disk-threshold branch from 68d15dd to 9b1875b Compare June 11, 2026 10:34
@delthas delthas requested review from a team and benzekrimaha June 11, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants