From 2330bb89368c46d0bbc466b14f2152d0db7b6555 Mon Sep 17 00:00:00 2001 From: Leonardo da Rosa Date: Thu, 26 Jan 2023 13:36:50 -0300 Subject: [PATCH 1/2] Update message link pointing to deprecated docs in migration notifier Now, the link points to `Batched Background Migration` docs, instead of `Background Migrations (deprecated)`. --- notifier/migration.rb | 4 +-- .../migration-testing/v4/expected-comment.txt | 33 ++++++++++++------- notifier/spec/warnings_spec.rb | 2 +- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/notifier/migration.rb b/notifier/migration.rb index c4510aab..f3bdaed3 100644 --- a/notifier/migration.rb +++ b/notifier/migration.rb @@ -10,7 +10,7 @@ class Migration TYPE_BACKGROUND_BATCH = 'background_batch' TIMING_GUIDELINES = 'https://docs.gitlab.com/ee/development/migration_style_guide.html#how-long-a-migration-should-take' POST_DEPLOY_MIGRATION_GUIDE = 'https://docs.gitlab.com/ee/development/post_deployment_migrations.html' - BACKGROUND_MIGRATION_GUIDE = 'https://docs.gitlab.com/ee/development/background_migrations.html' + BATCHED_BACKGROUND_MIGRATION_GUIDE = 'https://docs.gitlab.com/ee/development/database/batched_background_migrations.html' def self.background_migration_batch_from_directory(directory) query_details_path = directory.join('query-details.json') @@ -173,7 +173,7 @@ class Migration "to comply with [timing guidelines](#{TIMING_GUIDELINES}). It took #{walltime_minutes}, " \ "but should not exceed #{time_guidance_minutes}" else - "#{name_formatted} may need a [background migration](#{BACKGROUND_MIGRATION_GUIDE}) to " \ + "#{name_formatted} may need a [batched background migration](#{BATCHED_BACKGROUND_MIGRATION_GUIDE}) to " \ "comply with [timing guidelines](#{TIMING_GUIDELINES}). It took #{walltime_minutes}, " \ "but should not exceed #{time_guidance_minutes}" end diff --git a/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt b/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt index 96dc740d..793bdbad 100644 --- a/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt +++ b/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt @@ -128,9 +128,9 @@ Migrations included in this change have been executed on gitlab.com data for tes * Duration: 1.2 s * Database size change: +32.00 KiB -| Query | Calls | Total Time | Max Time | Mean Time | Rows | -| ----- | ----- | ---------- | -------- | --------- | ---- | -|
CREATE TABLE "efficiently_ordered_columns_tables" ("line_attr" line, "circle_attr" circle, "uuid_attr" uuid, "point_attr" point, "id" bigserial primary key, "bigserial_attr" bigserial, "bigint_attr" bigint, "float_attr" float, "time_attr" time, "timestamp_attr" timestamp, "date_attr" date, "integer_attr" integer, "oid_attr" oid, "smallint_attr" smallint, "boolean_attr" boolean, "inet_attr" inet, "jsonb_attr" jsonb, "text_attr" text) /*application:test,db_config_name:main,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| 1 | 9.4 ms | 9.4 ms | 9.4 ms | 0 | +| Calls | Total Time | Max Time | Mean Time | Rows | Query | +| ----- | ---------- | -------- | --------- | ---- | ----- | +| 1 | 9.4 ms | 9.4 ms | 9.4 ms | 0 |
CREATE TABLE "efficiently_ordered_columns_tables" ("line_attr" line, "circle_attr" circle, "uuid_attr" uuid, "point_attr" point, "id" bigserial primary key, "bigserial_attr" bigserial, "bigint_attr" bigint, "float_attr" float, "time_attr" time, "timestamp_attr" timestamp, "date_attr" date, "integer_attr" integer, "oid_attr" oid, "smallint_attr" smallint, "boolean_attr" boolean, "inet_attr" inet, "jsonb_attr" jsonb, "text_attr" text) /*application:test,db_config_name:main,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| @@ -155,9 +155,9 @@ Migrations included in this change have been executed on gitlab.com data for tes * Duration: 1.2 s * Database size change: +40.00 KiB -| Query | Calls | Total Time | Max Time | Mean Time | Rows | -| ----- | ----- | ---------- | -------- | --------- | ---- | -|
CREATE TABLE "inefficiently_ordered_columns_tables" ("id" bigserial primary key, "text_attr" text, "boolean_attr" boolean, "smallint_attr" smallint, "integer_attr" integer, "point_attr" point, "circle_attr" circle, "line_attr" line) /*application:test,db_config_name:main,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| 1 | 5.7 ms | 5.7 ms | 5.7 ms | 0 | +| Calls | Total Time | Max Time | Mean Time | Rows | Query | +| ----- | ---------- | -------- | --------- | ---- | ----- | +| 1 | 5.7 ms | 5.7 ms | 5.7 ms | 0 |
CREATE TABLE "inefficiently_ordered_columns_tables" ("id" bigserial primary key, "text_attr" text, "boolean_attr" boolean, "smallint_attr" smallint, "integer_attr" integer, "point_attr" point, "circle_attr" circle, "line_attr" line) /*application:test,db_config_name:main,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| :warning: Column ordering suggestions @@ -234,6 +234,15 @@ Migrations included in this change have been executed on gitlab.com data for tes ### Background migrations +#### Background Migration: TestBackgroundMigration + +Sampled 0 batches + + +No histogram available for visualization + +No histogram available for visualization + --- @@ -409,9 +418,9 @@ Migrations included in this change have been executed on gitlab.com data for tes * Duration: 1.2 s * Database size change: +40.00 KiB -| Query | Calls | Total Time | Max Time | Mean Time | Rows | -| ----- | ----- | ---------- | -------- | --------- | ---- | -|
CREATE TABLE "efficiently_ordered_columns_tables" ("line_attr" line, "circle_attr" circle, "uuid_attr" uuid, "point_attr" point, "id" bigserial primary key, "bigserial_attr" bigserial, "bigint_attr" bigint, "float_attr" float, "time_attr" time, "timestamp_attr" timestamp, "date_attr" date, "integer_attr" integer, "oid_attr" oid, "smallint_attr" smallint, "boolean_attr" boolean, "inet_attr" inet, "jsonb_attr" jsonb, "text_attr" text) /*application:test,db_config_name:ci,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| 1 | 12.0 ms | 12.0 ms | 12.0 ms | 0 | +| Calls | Total Time | Max Time | Mean Time | Rows | Query | +| ----- | ---------- | -------- | --------- | ---- | ----- | +| 1 | 12.0 ms | 12.0 ms | 12.0 ms | 0 |
CREATE TABLE "efficiently_ordered_columns_tables" ("line_attr" line, "circle_attr" circle, "uuid_attr" uuid, "point_attr" point, "id" bigserial primary key, "bigserial_attr" bigserial, "bigint_attr" bigint, "float_attr" float, "time_attr" time, "timestamp_attr" timestamp, "date_attr" date, "integer_attr" integer, "oid_attr" oid, "smallint_attr" smallint, "boolean_attr" boolean, "inet_attr" inet, "jsonb_attr" jsonb, "text_attr" text) /*application:test,db_config_name:ci,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| @@ -436,9 +445,9 @@ Migrations included in this change have been executed on gitlab.com data for tes * Duration: 1.2 s * Database size change: +48.00 KiB -| Query | Calls | Total Time | Max Time | Mean Time | Rows | -| ----- | ----- | ---------- | -------- | --------- | ---- | -|
CREATE TABLE "inefficiently_ordered_columns_tables" ("id" bigserial primary key, "text_attr" text, "boolean_attr" boolean, "smallint_attr" smallint, "integer_attr" integer, "point_attr" point, "circle_attr" circle, "line_attr" line) /*application:test,db_config_name:ci,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| 1 | 19.2 ms | 19.2 ms | 19.2 ms | 0 | +| Calls | Total Time | Max Time | Mean Time | Rows | Query | +| ----- | ---------- | -------- | --------- | ---- | ----- | +| 1 | 19.2 ms | 19.2 ms | 19.2 ms | 0 |
CREATE TABLE "inefficiently_ordered_columns_tables" ("id" bigserial primary key, "text_attr" text, "boolean_attr" boolean, "smallint_attr" smallint, "integer_attr" integer, "point_attr" point, "circle_attr" circle, "line_attr" line) /*application:test,db_config_name:ci,line:/lib/gitlab/database/migration_helpers/v2.rb:46:in `create_table'*/
| :warning: Column ordering suggestions diff --git a/notifier/spec/warnings_spec.rb b/notifier/spec/warnings_spec.rb index 07a08c05..253bc757 100644 --- a/notifier/spec/warnings_spec.rb +++ b/notifier/spec/warnings_spec.rb @@ -23,7 +23,7 @@ RSpec.describe Warnings do })]) expect(subject.render).to include('did not complete') - expect(subject.render).to include('[background migration]') + expect(subject.render).to include('[batched background migration]') expect(subject.render).to include('(`@gitlab-org/release/managers`)') expect(subject.render).to include('222.49') end -- GitLab From 570955b177e9dbfa122d1456c4a17471700d3f85 Mon Sep 17 00:00:00 2001 From: Leonardo da Rosa Date: Thu, 26 Jan 2023 13:55:24 -0300 Subject: [PATCH 2/2] Undo changes in Background migration section --- .../fixtures/migration-testing/v4/expected-comment.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt b/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt index 793bdbad..d80e5e87 100644 --- a/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt +++ b/notifier/spec/fixtures/migration-testing/v4/expected-comment.txt @@ -234,15 +234,6 @@ Migrations included in this change have been executed on gitlab.com data for tes ### Background migrations -#### Background Migration: TestBackgroundMigration - -Sampled 0 batches - - -No histogram available for visualization - -No histogram available for visualization - --- -- GitLab