From 2fc1e268e20d3b2310c89690863bfa98befb330b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 14 Jul 2025 23:37:46 -0700 Subject: [PATCH 1/2] Disable advisory locks in db:check-schema CI job This CI job is the slowest job in a tier-3 pipeline now, and its duration has crept up to 60 minutes over the last year. Part of the reason that it is slow now is that for every database migration for 3 databases, Rails takes an advisory lock. Since this CI job is only concerned about migrating the database to check the schema, we should not need to worry about concurrent access issues. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/555535 --- .gitlab/ci/database.gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab/ci/database.gitlab-ci.yml b/.gitlab/ci/database.gitlab-ci.yml index d9776e7074383e..eae70213c639be 100644 --- a/.gitlab/ci/database.gitlab-ci.yml +++ b/.gitlab/ci/database.gitlab-ci.yml @@ -152,6 +152,8 @@ db:check-schema: script: - | function db_check_schema() { + curl -L -o /tmp/yq https://github.com/mikefarah/yq/releases/download/v4.46.1/yq_linux_amd64 && chmod +x /tmp/yq + /tmp/yq eval '.test.[].advisory_locks = false' -i config/database.yml bundle exec rake db:drop db:create db:migrate scripts/validate_migration_timestamps scripts/validate_migration_checksum -- GitLab From dcd07ed1533a7dea5264f98e1b3b8644c0e5f037 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 14 Jul 2025 23:44:33 -0700 Subject: [PATCH 2/2] Add test comment This should trigger the db:check-schema job. --- scripts/regenerate-schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/regenerate-schema b/scripts/regenerate-schema index 853e00586cb763..2aabbdaadfa405 100755 --- a/scripts/regenerate-schema +++ b/scripts/regenerate-schema @@ -1,5 +1,5 @@ #!/usr/bin/env ruby - +# test comment # frozen_string_literal: true ENV['RAILS_ENV'] = 'test' -- GitLab