From 34e83deefad4a2f80cc63439295d813fee124945 Mon Sep 17 00:00:00 2001 From: gdk Date: Thu, 17 Jul 2025 23:31:30 +0000 Subject: [PATCH] Finalize BBM BackfillMissingOrganizationIdOnCiRunnerMachines This migration was finished at `2025-06-30 06:16:04 UTC`, you can confirm the status using our [batched background migration chatops commands](https://docs.gitlab.com/ee/development/database/batched_background_migrations.html#monitor-the-progress-and-status-of-a-batched-background-migration). To confirm it is finished you can run: ``` /chatops run batched_background_migrations status 2000442 --database ci ``` The last time this background migration was triggered was in [db/post_migrate/20250620094653_queue_backfill_missing_organization_id_on_ci_runner_machines.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/post_migrate/20250620094653_queue_backfill_missing_organization_id_on_ci_runner_machines.rb) You can read more about the process for finalizing batched background migrations in https://docs.gitlab.com/ee/development/database/batched_background_migrations.html . As part of our process we want to ensure all batched background migrations have had at least one [required stop](https://docs.gitlab.com/ee/development/database/required_stops.html) to process the migration. Therefore we can finalize any batched background migration that was added before the last required stop. This change was generated by [gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper) in [CI](https://ops.gitlab.net/gitlab-com/database-team/gitlab-com-database-testing/-/jobs/19363183) using the `Keeps::OverdueFinalizeBackgroundMigration` keep. To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the label ~"GitLab Housekeeper" and consider pinging the author of this keep. Changelog: other --- ..._organization_id_on_ci_runner_machines.yml | 12 ++++++----- ...g_organization_id_on_ci_runner_machines.rb | 21 +++++++++++++++++++ db/schema_migrations/20250717233115 | 1 + 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb create mode 100644 db/schema_migrations/20250717233115 diff --git a/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml b/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml index 27b9dfcc93de42..b15a2cacd6a640 100644 --- a/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml +++ b/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml @@ -1,11 +1,13 @@ --- migration_job_name: BackfillMissingOrganizationIdOnCiRunnerMachines -description: > - Backfill organization_id column for machines associated with non-instance type runners with default organization id. - This is the second attempt to initialize the values that were missed in a time window just after - BackfillOrganizationIdOnCiRunnerMachines was started. +description: 'Backfill organization_id column for machines associated with non-instance + type runners with default organization id. This is the second attempt to initialize + the values that were missed in a time window just after BackfillOrganizationIdOnCiRunnerMachines + was started. + + ' feature_category: fleet_visibility introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/195123 milestone: '18.2' queued_migration_version: 20250620094653 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20250717233115' diff --git a/db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb b/db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb new file mode 100644 index 00000000000000..7b3a377e21de48 --- /dev/null +++ b/db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeHkBackfillMissingOrganizationIdOnCiRunnerMachines < Gitlab::Database::Migration[2.3] + milestone '18.3' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillMissingOrganizationIdOnCiRunnerMachines', + table_name: :ci_runner_machines, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20250717233115 b/db/schema_migrations/20250717233115 new file mode 100644 index 00000000000000..1ff62bcb3f08e7 --- /dev/null +++ b/db/schema_migrations/20250717233115 @@ -0,0 +1 @@ +633e5f182e42a7ca13441d70614ad74ce7574d73b1dfb61f49036b5873fa7f05 \ No newline at end of file -- GitLab