Introduce Cells claims verification workers and cron scheduling
What does this MR do and why?
- Add
Cells::ClaimsVerificationWorkerto run verification per model, gated by a dynamic ops feature flag per model name. This worker callsCells::Claims::VerificationServiceintroduced in !226233 (merged), to backfill and reconcile changes between Rails and Topology Service. - Add
Cells::ScheduleClaimsVerificationWorkeras a cron job that enqueues aClaimsVerificationWorkerfor every model registered viaCells::Claimablewith 10 mins delay. This cronjob runs once every Saturdays, and the schedule is randomized between 00:00 to 23:59 to avoid thunderring herd from all cells running this worker. This is done viaGitlab::Scheduling::ScheduleWithinWorker
References
gitlab-com/gl-infra/tenant-scale/cells-infrastructure/team#468
How to set up and validate locally
-
In console, run
Rails.application.eager_load!to ensure all models have been loaded -
Enable the feature flags:
%w[ cells_claims_verification_worker_organizations_organization cells_claims_verification_worker_project cells_claims_verification_worker_namespace cells_claims_verification_worker_user cells_claims_verification_worker_key cells_claims_verification_worker_email cells_claims_verification_worker_gpg_key cells_claims_verification_worker_redirect_route cells_claims_verification_worker_route cells_claims_verification_worker_service_desk_setting ].each { |flag| Feature.enable(flag) } -
Run the
Cells::ScheduleClaimsVerificationWorkerCells::ScheduleClaimsVerificationWorker.new.perform -
Check that the
claimsrecords are backfilled in topology service database:gdk psql -d topology_service SELECT * FROM claims;
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Marco Gregorius