Add ops feature flags to control FinishedPipelinesSyncCronWorker concurrency

What does this MR do and why?

The Ci::ClickHouse::FinishedPipelinesSyncCronWorker currently dispatches a fixed number of FinishedPipelinesSyncWorker jobs (default: 1, configured via 1_settings.rb cron args). When there is a backlog of unprocessed ci_finished_pipeline_ch_sync_events, the single-worker default is insufficient to drain the queue in a timely manner.

This MR introduces two ops-type feature flags that allow operators to increase the number of sync workers without requiring a code change or deploy:

Flag Workers
(none enabled) Falls back to cron args (default: 1)
ci_finished_pipelines_sync_medium_workers 3
ci_finished_pipelines_sync_high_workers 5

Feature flags take precedence over cron args, so enabling a flag will override the args value configured in 1_settings.rb. When both flags are enabled, high takes priority over medium.

How to set up and validate locally

  1. Enable the medium workers flag:
    Feature.enable(:ci_finished_pipelines_sync_medium_workers)
  2. Trigger the cron worker and verify 3 sync workers are enqueued.
  3. Enable the high workers flag:
    Feature.enable(:ci_finished_pipelines_sync_high_workers)
  4. Trigger the cron worker and verify 5 sync workers are enqueued.
  5. Disable both flags and verify the worker falls back to the cron args default.

Feature flags

  • ci_finished_pipelines_sync_medium_workers — dispatches 3 workers (default: off)
  • ci_finished_pipelines_sync_high_workers — dispatches 5 workers (default: off)

Both are ops type flags scoped to :instance.

MR acceptance checklist

This checklist encourages us to confirm any changes have been thoroughly reviewed to reduce the risk of incidents in production.

  • This MR has been reviewed by a maintainer.
  • This change has been verified locally.
  • The feature flags have been documented above.

Merge request reports

Loading