Batched Background Migration Fails: ERROR: relation \"ci_runner_machines_687967fa8a\" does not exist
Description
The RequeueDeleteOrphanedPartitionedCiRunnerMachineRecords
migration cannot run as the table ci_runner_machines_687967fa8a
no longer exists:
"exception.class": "ActiveRecord::StatementInvalid",
"exception.message": "PG::UndefinedTable: ERROR: relation \"ci_runner_machines_687967fa8a\" does not exist\nLINE 5: WHERE indrelid = '\"ci_runner_machines_687967fa8a\"'...\n ^\n",
"exception.backtrace": [
"activerecord (7.0.8.7) lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `exec'",
"activerecord (7.0.8.7) lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `block (2 levels) in query'",
Environment
Impacted offerings:
- GitLab Self-Managed
Impacted versions:
- 17.10.1
Solution
This is a known bug fixed in 17.10.3.
Cause
Due to a recent change, specifically, the ci_runner_machines
table was renamed, and the old ci_runner_machines
table was moved to ci_runner_machines_archived
. Additionally, a migration reordering caused a missing table reference, leading to this issue.