Draft: Remove backfill_ci_finished_builds BBM and mode-split logic
What does this MR do and why?
Closes #592894.
Cleans up the BackfillCiFinishedBuildsToClickHouse BBM and related code after the BBM was finalized in 19.0. Per the batched background migration cleanup guidelines:
Once a batched background migration has completed, is finalized and has not been re-queued, the migration code and its associated tests can be deleted after the next required stop following the finalization.
19.2 is the next required stop after 19.0, so this is the correct release for cleanup.
What this MR removes
1. BBM code and YAML
lib/gitlab/background_migration/backfill_ci_finished_builds_to_click_house.rbee/lib/ee/gitlab/background_migration/backfill_ci_finished_builds_to_click_house.rbee/spec/lib/ee/gitlab/background_migration/backfill_ci_finished_builds_to_click_house_spec.rbdb/docs/batched_background_migrations/backfill_ci_finished_builds_to_click_house.yml
2. Enqueue and finalize migrations + schema_migrations
db/post_migrate/20260204083514_queue_backfill_ci_finished_builds_to_click_house.rbdb/post_migrate/20260413072219_finalize_backfill_ci_finished_builds_to_click_house.rbdb/schema_migrations/20260204083514db/schema_migrations/20260413072219spec/migrations/20260204083514_queue_backfill_ci_finished_builds_to_click_house_spec.rb
3. CiFinishedBuildsConsistencyHelper and all backfill_in_progress? usage
lib/click_house/migration_support/ci_finished_builds_consistency_helper.rbspec/lib/click_house/migration_support/ci_finished_builds_consistency_helper_spec.rbbackfill_in_progress?call inee/app/workers/click_house/ci_finished_builds_sync_cron_worker.rbbackfill_in_progress?call inlib/ci/job_analytics/query_builder.rb— now always usesFinishedBuildsFinder- Backfill stubs in
spec/requests/api/graphql/project/job_analytics_spec.rb
4. Backfill mode-split changes from !226068 (merged)
recent/backfillworker split inci_finished_builds_sync_cron_worker.rbmodeparameter fromci_finished_builds_sync_service.rb(incl.MODES,RECENT_THRESHOLD,apply_mode_filter, conditional ordering, mode in service payload, lock-key mode component)order_by_build_finished_atscope fromfinished_build_ch_sync_event.rb- All related specs
Notes
- Feature flag
ci_finished_builds_ch_sync_mode_splitis already gone — it was removed in master in commit 8840b20f. No action needed on this part of the issue task list. - Sidekiq backward compatibility:
CiFinishedBuildsSyncWorker#performkeeps a deprecated_mode = nilargument (ignored) for one release per the Sidekiq compatibility guidelines. In-flight jobs scheduled by the old 3-arg cron path will still execute. The argument can be fully removed in 19.3. - Follow-up:
ClickHouse::Finders::Ci::FinishedBuildsDeduplicatedFinderwas only used by the now-removedbackfill_in_progress?branch in the query builder. It is now unused in production code and can be removed in a separate cleanup MR.
Sibling MR
!241619 (merged) removes the temporary index_ci_finished_build_ch_sync_events_on_mode_filter index from p_ci_finished_build_ch_sync_events.
The two MRs are independent and can be merged in any order. After both merge, the mode-split feature is fully removed.
Verification
$ bundle exec rspec \
ee/spec/models/ci/finished_build_ch_sync_event_spec.rb \
ee/spec/services/click_house/data_ingestion/ci_finished_builds_sync_service_spec.rb \
ee/spec/workers/click_house/ci_finished_builds_sync_cron_worker_spec.rb \
ee/spec/workers/click_house/ci_finished_builds_sync_worker_spec.rb \
spec/lib/ci/job_analytics/query_builder_spec.rb \
spec/requests/api/graphql/project/job_analytics_spec.rb
...
174 examples, 0 failuresRubocop is clean on all touched files.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- I have evaluated the MR acceptance checklist for this MR.