From 433b04dd4c8e7b72a5abc08f19e93ddf05c48bda Mon Sep 17 00:00:00 2001 From: gdk Date: Mon, 20 Oct 2025 23:22:20 +0000 Subject: [PATCH] Finalize BBM BackfillJiraTrackerDataShardingKey This migration was finished at `2025-08-26 18:29:03 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 2001046 --database main ``` The last time this background migration was triggered was in [db/post_migrate/20250818084641_requeue_backfill_jira_tracker_data_sharding_key.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/post_migrate/20250818084641_requeue_backfill_jira_tracker_data_sharding_key.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/20795583) 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 --- ...ackfill_jira_tracker_data_sharding_key.yml | 6 +++--- ...backfill_jira_tracker_data_sharding_key.rb | 21 +++++++++++++++++++ db/schema_migrations/20251020232206 | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 db/post_migrate/20251020232206_finalize_hk_backfill_jira_tracker_data_sharding_key.rb create mode 100644 db/schema_migrations/20251020232206 diff --git a/db/docs/batched_background_migrations/backfill_jira_tracker_data_sharding_key.yml b/db/docs/batched_background_migrations/backfill_jira_tracker_data_sharding_key.yml index ce3167e908af7d..2d317f33320e7f 100644 --- a/db/docs/batched_background_migrations/backfill_jira_tracker_data_sharding_key.yml +++ b/db/docs/batched_background_migrations/backfill_jira_tracker_data_sharding_key.yml @@ -1,10 +1,10 @@ --- migration_job_name: BackfillJiraTrackerDataShardingKey -description: Sets sharding key (project_id/group_id/organization_id) on jira_tracker_data based on associated integration - Originally introduced by https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194007 +description: Sets sharding key (project_id/group_id/organization_id) on jira_tracker_data + based on associated integration Originally introduced by https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194007 Re-ran to fix several leftover records. feature_category: integrations introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197199 milestone: '18.4' queued_migration_version: 20250818084641 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20251020232206' diff --git a/db/post_migrate/20251020232206_finalize_hk_backfill_jira_tracker_data_sharding_key.rb b/db/post_migrate/20251020232206_finalize_hk_backfill_jira_tracker_data_sharding_key.rb new file mode 100644 index 00000000000000..c59b771f37daac --- /dev/null +++ b/db/post_migrate/20251020232206_finalize_hk_backfill_jira_tracker_data_sharding_key.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeHkBackfillJiraTrackerDataShardingKey < Gitlab::Database::Migration[2.3] + milestone '18.6' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main_org + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillJiraTrackerDataShardingKey', + table_name: :jira_tracker_data, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20251020232206 b/db/schema_migrations/20251020232206 new file mode 100644 index 00000000000000..fe31b386cc951a --- /dev/null +++ b/db/schema_migrations/20251020232206 @@ -0,0 +1 @@ +750ad9116c86e753a452f9104c1f31a282b3162ae1465515de8a5c7bf1dec980 \ No newline at end of file -- GitLab