Skip to content

Add an option to spread indexing pipelines over time - #6655

Open
loutPhilipps wants to merge 4 commits into
mainfrom
lout.philipps/byoc/add-spread-indexing-pipelines-option
Open

Add an option to spread indexing pipelines over time#6655
loutPhilipps wants to merge 4 commits into
mainfrom
lout.philipps/byoc/add-spread-indexing-pipelines-option

Conversation

@loutPhilipps

Copy link
Copy Markdown
Contributor

Tip

This PR is better reviewed commit-by-commit.

Problem

An indexer node's pipelines are started at the same time with the same commit timeout, leading to them committing at the same time. This is not an efficient usage of resources when there are many pipelines on a single indexer node.

This problem was addressed in #4877 with the cooperative indexing feature by introducing both a time spread of pipelines, as well as a semaphore to prevent running too many pipelines concurrently.

When having a large index though, we don't really want to have a semaphore, but do want to spread indexing pipelines.

What this PR does

Add an option enable_spread_indexing_pipelines on the indexer's config. For backwards compatibility reasons, enabling cooperative indexing also enables this feature, with the addition of a semaphore.

The implementation of CooperativeIndexingCycle has been mostly left intact, with the indexing_permits becoming optional.

@loutPhilipps
loutPhilipps requested a review from a team as a code owner August 3, 2026 18:58
@loutPhilipps
loutPhilipps force-pushed the lout.philipps/byoc/add-spread-indexing-pipelines-option branch from 927f22c to 2262d4a Compare August 3, 2026 18:59
@loutPhilipps loutPhilipps changed the title [byoc] Add an option to spread indexing pipelines over time Add an option to spread indexing pipelines over time Aug 3, 2026
Comment on lines +546 to 553
let indexing_cycle_opt: Option<IndexingCycle> =
(spread_indexing_pipelines || cooperative_indexing_permits_opt.is_some()).then(|| {
IndexingCycle::new(
&pipeline_id,
indexing_settings.commit_timeout(),
cooperative_indexing_permits,
cooperative_indexing_permits_opt,
)
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where we enable the IndexingCycle, either if spreading pipelines or if cooperative indexing is enabled

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 927f22cfca

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread quickwit/quickwit-indexing/src/actors/indexing_service.rs
Comment thread quickwit/quickwit-indexing/src/actors/indexer.rs
@loutPhilipps
loutPhilipps force-pushed the lout.philipps/byoc/add-spread-indexing-pipelines-option branch from eb67cf2 to 815d873 Compare August 3, 2026 19:19
@loutPhilipps
loutPhilipps force-pushed the lout.philipps/byoc/add-spread-indexing-pipelines-option branch from 815d873 to e84a525 Compare August 3, 2026 19:27
let num_pipelines = 100;
let num_steps = 15;
let semaphore = Arc::new(Semaphore::new(num_threads));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My two cents is that having the semaphore in the reconcile test doesn't change anything to the test so I decided to test the general case instead. I can add another test for nudging to phase with cooperative indexing if needed.

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