Skip to content

Ensure that sharding_key_id on project runner points to valid project

We recently took 2 actions to ensure that sharding_key_id on project runners is valid, so that runners are correctly moved by OrgMover in the future:

  • added a worker to recalculate sharding_key_id when the project pointed to by ci_runners.sharding_key_id is deleted.
  • added a batched migration that iterates project runners missing a matching ci_runners_projects record but do have a fallback ci_runner_projects record, to assign the project_id of the oldest ci_runner_projects record for that runner id.

Unfortunately, some other scenarios remain that could lead to a sharding_key_id that points to a value that is not represented in a ci_runner_projects join record, and this is visible through the slow growth of records in this situation: