Skip to content

feat(ingest): add max_shards cap to IngestSettings and ScalingArbiter#6470

Draft
fulmicoton-dd wants to merge 1 commit into
mainfrom
paul-masurel/ingest-max-shards
Draft

feat(ingest): add max_shards cap to IngestSettings and ScalingArbiter#6470
fulmicoton-dd wants to merge 1 commit into
mainfrom
paul-masurel/ingest-max-shards

Conversation

@fulmicoton-dd
Copy link
Copy Markdown
Collaborator

Summary

  • Adds max_shards: Option<NonZeroUsize> to IngestSettings (defaults to None = uncapped; backwards-compatible)
  • Validates max_shards >= min_shards at index config build time
  • ScalingArbiter::should_scale now accepts RangeInclusive<NonZeroUsize> instead of a bare min_shards; scale-up is capped at max_shards using clamp
  • When num_open_shards >= max_shards, the scale-up block is skipped rather than returning early, so the scale-down path can still fire (e.g. when the cap is lowered after shards are already open)

Test plan

  • cargo nextest run -p quickwit-control-plane -p quickwit-config --all-features passes
  • New test_scaling_arbiter_max_shards covers: at-cap suppression, below-cap scale-up clamping, above-cap scale-down fall-through
  • Setting ingest_settings.max_shards in an index config is respected at runtime

Adds `max_shards: Option<NonZeroUsize>` to `IngestSettings` so operators
can bound the number of shards the control plane will open for a source.
The scaling arbiter now accepts a `RangeInclusive<NonZeroUsize>` and
clamps scale-up decisions within [min_shards, max_shards]; the scale-down
path is unblocked when shards exceed the cap (e.g. after a config change).
@fulmicoton-dd fulmicoton-dd requested a review from PSeitz-dd May 28, 2026 09:03
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.

1 participant