Skip to content

feat(query-coordinator): Add query job coordination loop. - #2525

Draft
Bill-hbrhbr wants to merge 95 commits into
y-scope:mainfrom
Bill-hbrhbr:query-coordinator/coordinator-loop
Draft

feat(query-coordinator): Add query job coordination loop.#2525
Bill-hbrhbr wants to merge 95 commits into
y-scope:mainfrom
Bill-hbrhbr:query-coordinator/coordinator-loop

Conversation

@Bill-hbrhbr

@Bill-hbrhbr Bill-hbrhbr commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Description

Add the query coordinator loop, following the compression coordinator’s structure and using #2513’s QueryJobHandle interface.

  • Poll pending query jobs, decode their MessagePack configuration, and dispatch searches under a concurrency limit.
  • Recover running jobs using their persisted Spider job IDs.
  • Pass SearchJobConfig and OutputHandle to the handler.
  • Add coordinator configuration, resource-group initialization, shutdown signaling, and the query table’s dispatch_time column.

Depends on #2513 and uses #2512’s output-handle definitions.

Bill-hbrhbr and others added 30 commits August 27, 2026 13:17
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
… search results to the results cache.

Implements `query::clp_s_query_to_results_cache`, mirroring the Celery task in
`job_orchestration.executor.query.fs_search_task`. The task resolves one archive from either
filesystem- or S3-backed archive output, invokes `clp-s s`, and lets `clp-s` write the matches to
MongoDB itself. Aggregation and the file/network/reducer output handlers are not supported.

* Add `OutputHandle` to `task_io::query` and make `ClpSQueryOption::max_num_results` optional, so
  `None` means no task-level limit rather than silently inheriting the `clp-s` default of 1000.
  Correct the `begin_timestamp`/`end_timestamp` doc comments, which said microseconds; the whole
  chain is milliseconds.
* Add `ArchiveOutput::dataset_archive_object_key`, and move `clp_binary_path` and
  `s3_credential_env` out of the compression task into `task::clp_s`, so the compression and query
  paths share one definition of the archive layout and of the AWS credential environment.
* Resolve a `None` dataset to `default` on the Rust side and always pass `--dataset`, so every
  result document carries a truthful dataset name instead of an empty string.
* Pass the query job ID into `build_clp_s_search_args_for_result_cache` and derive the
  results-cache collection name inside it.
* Rename `build_clp_s_search_args` to `build_clp_s_search_args_for_result_cache`.
* Log an error when archive-input resolution fails.
* Tighten the task's docstrings and error messages.
…`clp-s` search task:

* Rename the `build_clp_s_search_args_for_result_cache` unit tests to match the function's name.
* Rename `results_cache_uri` to `result_cache_uri`.
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Bill-hbrhbr Bill-hbrhbr changed the title Query coordinator/coordinator loop feat(query-coordinator): Add query job coordination loop. Sep 12, 2026
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.

2 participants