There was an error fetching the job.
rspec migration pg13 single-db 3/8
Passed Started
by
@gitlab-bot

🤖 GitLab Bot 🤖
1Running with gitlab-runner 15.9.0~beta.212.g8ccc65e7 (8ccc65e7)2 on green-2.private.runners-manager.gitlab.com/gitlab.com/gitlab-org GaSD-S1F, system ID: s_5651e5b5643b3 feature flags: FF_NETWORK_PER_BUILD:true, FF_USE_FASTZIP:true, FF_USE_IMPROVED_URL_MASKING:true6Using Docker executor with image registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.18-rust-1.65-node-16.14-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-109-yarn-1.22-graphicsmagick-1.3.36 ...7Starting service postgres:13 ...8Pulling docker image postgres:13 ...9Using docker image sha256:dd421ca1f7f13d81c5c145d77d97d8d84cd0e6f1e045936ee506ce0f50ee397a for postgres:13 with digest postgres@sha256:00f455399f30cc3f2fe4185476601438b7a4959c74653665582d7c313a783d51 ...10Starting service redis:6.2-alpine ...11Pulling docker image redis:6.2-alpine ...12Using docker image sha256:3616f0c0705d2a35d30dde109daf3cbe58ae7284121aafa6f5cfa987db98d1a8 for redis:6.2-alpine with digest redis@sha256:edddbcad5a41d58df2f142d68439922f1860ea902903d016257337c3342f30fc ...13Waiting for services to be up and running (timeout 30 seconds)...14Authenticating with credentials from job payload (GitLab Registry)15Pulling docker image registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.18-rust-1.65-node-16.14-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-109-yarn-1.22-graphicsmagick-1.3.36 ...16Using docker image sha256:7a1b51158a1ee23b080b514ce6ebbf52ac51585877198fb52709e5cd01805a77 for registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.18-rust-1.65-node-16.14-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-109-yarn-1.22-graphicsmagick-1.3.36 with digest registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.18-rust-1.65-node-16.14-postgresql-13@sha256:412d55913d43377094427ced549cb422ed2f2c7223e6a605d0d3e0151cb892b0 ...18Running on runner-gasd-s1f-project-278964-concurrent-0 via runner-gasd-s1f-private-1680169856-92073227...20$ eval "$CI_PRE_CLONE_SCRIPT"21Fetching changes with git depth set to 20...22Initialized empty Git repository in /builds/gitlab-org/gitlab/.git/23Created fresh repository.24remote: Enumerating objects: 135903, done. 25remote: Counting objects: 100% (135903/135903), done. 26remote: Compressing objects: 100% (88560/88560), done. 27remote: Total 135903 (delta 58315), reused 94618 (delta 42152), pack-reused 0 28Receiving objects: 100% (135903/135903), 121.35 MiB | 29.91 MiB/s, done.29Resolving deltas: 100% (58315/58315), done.31 * [new ref] refs/pipelines/822866544 -> refs/pipelines/82286654432Checking out 523abdde as detached HEAD (ref is refs/merge-requests/116270/merge)...33Skipping Git submodules setup34$ git remote set-url origin "${CI_REPOSITORY_URL}"36Checking cache for ruby-gems-debian-bullseye-ruby-3.0-16...37cache.zip is up to date 38Successfully extracted cache39Checking cache for gitaly-ruby-gems-debian-bullseye-ruby-3.0-16...40cache.zip is up to date 41Successfully extracted cache43Downloading artifacts for compile-test-assets (4031138198)...44Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4031138198 responseStatus=200 OK token=64_fFD9x45Downloading artifacts for detect-tests (4031138213)...46Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4031138213 responseStatus=200 OK token=64_fFD9x47Downloading artifacts for retrieve-tests-metadata (4031138217)...48Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4031138217 responseStatus=200 OK token=64_fFD9x49Downloading artifacts for setup-test-env (4031138204)...50Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4031138204 responseStatus=200 OK token=64_fFD9x52Using docker image sha256:7a1b51158a1ee23b080b514ce6ebbf52ac51585877198fb52709e5cd01805a77 for registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.18-rust-1.65-node-16.14-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-109-yarn-1.22-graphicsmagick-1.3.36 with digest registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.18-rust-1.65-node-16.14-postgresql-13@sha256:412d55913d43377094427ced549cb422ed2f2c7223e6a605d0d3e0151cb892b0 ...53$ echo $FOSS_ONLY54$ [ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb55$ export GOPATH=$CI_PROJECT_DIR/.go56$ mkdir -p $GOPATH57$ source scripts/utils.sh58$ source scripts/prepare_build.sh709Using decomposed database config (config/database.yml.postgresql)710Geo DB won't be set up.711$ setup_db_user_only712CREATE ROLE713GRANT714==> 'setup_db_user_only' succeeded in 0 seconds.715$ bundle exec rake db:drop db:create db:schema:load db:migrate gitlab:db:lock_writes716Dropped database 'gitlabhq_test'717Created database 'gitlabhq_test'718==> 'bundle exec rake db:drop db:create db:schema:load db:migrate gitlab:db:lock_writes' succeeded in 35 seconds.719$ setup_db_praefect720SELECT pg_catalog.set_config('search_path', '', false);721CREATE DATABASE praefect_test ENCODING 'UTF8';722==> 'setup_db_praefect' succeeded in 0 seconds.723$ source ./scripts/rspec_helpers.sh724$ run_timed_command "gem install knapsack --no-document"725$ gem install knapsack --no-document726Successfully installed knapsack-4.0.07271 gem installed728==> 'gem install knapsack --no-document' succeeded in 0 seconds.729$ echo -e "\e[0Ksection_start:`date +%s`:gitaly-test-spawn[collapsed=true]\r\e[0KStarting Gitaly"833$ rspec_paralellized_job "--tag ~quarantine --tag ~zoekt"834SKIP_FLAKY_TESTS_AUTOMATICALLY: false835RETRY_FAILED_TESTS_IN_NEW_PROCESS: true836KNAPSACK_GENERATE_REPORT: true837FLAKY_RSPEC_GENERATE_REPORT: true838KNAPSACK_TEST_FILE_PATTERN: spec/{migrations}{,/**/}*_spec.rb839KNAPSACK_LOG_LEVEL: debug840KNAPSACK_REPORT_PATH: knapsack/rspec_migration_pg13_single-db_3_8_report.json841FLAKY_RSPEC_SUITE_REPORT_PATH: rspec/flaky/report-suite.json842FLAKY_RSPEC_REPORT_PATH: rspec/flaky/all_rspec_migration_pg13_single-db_3_8_report.json843NEW_FLAKY_RSPEC_REPORT_PATH: rspec/flaky/new_rspec_migration_pg13_single-db_3_8_report.json844SKIPPED_FLAKY_TESTS_REPORT_PATH: rspec/flaky/skipped_flaky_tests_rspec_migration_pg13_single-db_3_8_report.txt845CRYSTALBALL: 846Knapsack node specs:847spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb848spec/migrations/schedule_purging_stale_security_scans_spec.rb849spec/migrations/20220106111958_add_insert_or_update_vulnerability_reads_trigger_spec.rb850spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb851spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb852spec/migrations/remove_wiki_notes_spec.rb853spec/migrations/20211214012507_backfill_incident_issue_escalation_statuses_spec.rb854spec/migrations/remove_invalid_integrations_spec.rb855spec/migrations/20220322132242_update_pages_onboarding_state_spec.rb856spec/migrations/20220223124428_schedule_merge_topics_with_same_name_spec.rb857spec/migrations/20220601152916_add_user_id_and_ip_address_success_index_to_authentication_events_spec.rb858spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb859spec/migrations/20220721031446_schedule_disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb860spec/migrations/20220601110011_schedule_remove_self_managed_wiki_notes_spec.rb861spec/migrations/20220622080547_backfill_project_statistics_with_container_registry_size_spec.rb862spec/migrations/20220307192610_remove_duplicate_project_tag_releases_spec.rb863spec/migrations/20220606082910_add_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb864spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb865spec/migrations/orphaned_invited_members_cleanup_spec.rb866spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb867spec/migrations/20220921093355_schedule_backfill_namespace_details_spec.rb868spec/migrations/20220725150127_update_jira_tracker_data_deployment_type_based_on_url_spec.rb869spec/migrations/20221101032521_add_default_preferred_language_to_application_settings_spec.rb870spec/migrations/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration_spec.rb871spec/migrations/20221110152133_delete_orphans_approval_rules_spec.rb872spec/migrations/set_email_confirmation_setting_from_soft_email_confirmation_ff_spec.rb873spec/migrations/recount_epic_cache_counts_v3_spec.rb874spec/migrations/20230202211434_migrate_redis_slot_keys_spec.rb875spec/migrations/ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb876spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb877spec/migrations/20230306195007_queue_backfill_project_wiki_repositories_spec.rb878spec/migrations/20230309071242_delete_security_policy_bot_users_spec.rb879Filter specs:880Running specs:881Running all node tests without filter882spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb883spec/migrations/schedule_purging_stale_security_scans_spec.rb884spec/migrations/20220106111958_add_insert_or_update_vulnerability_reads_trigger_spec.rb885spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb886spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb887spec/migrations/remove_wiki_notes_spec.rb888spec/migrations/20211214012507_backfill_incident_issue_escalation_statuses_spec.rb889spec/migrations/remove_invalid_integrations_spec.rb890spec/migrations/20220322132242_update_pages_onboarding_state_spec.rb891spec/migrations/20220223124428_schedule_merge_topics_with_same_name_spec.rb892spec/migrations/20220601152916_add_user_id_and_ip_address_success_index_to_authentication_events_spec.rb893spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb894spec/migrations/20220721031446_schedule_disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb895spec/migrations/20220601110011_schedule_remove_self_managed_wiki_notes_spec.rb896spec/migrations/20220622080547_backfill_project_statistics_with_container_registry_size_spec.rb897spec/migrations/20220307192610_remove_duplicate_project_tag_releases_spec.rb898spec/migrations/20220606082910_add_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb899spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb900spec/migrations/orphaned_invited_members_cleanup_spec.rb901spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb902spec/migrations/20220921093355_schedule_backfill_namespace_details_spec.rb903spec/migrations/20220725150127_update_jira_tracker_data_deployment_type_based_on_url_spec.rb904spec/migrations/20221101032521_add_default_preferred_language_to_application_settings_spec.rb905spec/migrations/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration_spec.rb906spec/migrations/20221110152133_delete_orphans_approval_rules_spec.rb907spec/migrations/set_email_confirmation_setting_from_soft_email_confirmation_ff_spec.rb908spec/migrations/recount_epic_cache_counts_v3_spec.rb909spec/migrations/20230202211434_migrate_redis_slot_keys_spec.rb910spec/migrations/ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb911spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb912spec/migrations/20230306195007_queue_backfill_project_wiki_repositories_spec.rb913spec/migrations/20230309071242_delete_security_policy_bot_users_spec.rb914Running all node tests without filter915Running all node tests without filter916Running command: bundle exec rspec -Ispec -rspec_helper --color --failure-exit-code 1 --error-exit-code 2 --format documentation --format RspecJunitFormatter --out rspec/junit_rspec.xml --tag ~quarantine --tag ~zoekt --default-path spec -- spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb spec/migrations/schedule_purging_stale_security_scans_spec.rb spec/migrations/20220106111958_add_insert_or_update_vulnerability_reads_trigger_spec.rb spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb spec/migrations/remove_wiki_notes_spec.rb spec/migrations/20211214012507_backfill_incident_issue_escalation_statuses_spec.rb spec/migrations/remove_invalid_integrations_spec.rb spec/migrations/20220322132242_update_pages_onboarding_state_spec.rb spec/migrations/20220223124428_schedule_merge_topics_with_same_name_spec.rb spec/migrations/20220601152916_add_user_id_and_ip_address_success_index_to_authentication_events_spec.rb spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb spec/migrations/20220721031446_schedule_disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb spec/migrations/20220601110011_schedule_remove_self_managed_wiki_notes_spec.rb spec/migrations/20220622080547_backfill_project_statistics_with_container_registry_size_spec.rb spec/migrations/20220307192610_remove_duplicate_project_tag_releases_spec.rb spec/migrations/20220606082910_add_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb spec/migrations/orphaned_invited_members_cleanup_spec.rb spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb spec/migrations/20220921093355_schedule_backfill_namespace_details_spec.rb spec/migrations/20220725150127_update_jira_tracker_data_deployment_type_based_on_url_spec.rb spec/migrations/20221101032521_add_default_preferred_language_to_application_settings_spec.rb spec/migrations/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration_spec.rb spec/migrations/20221110152133_delete_orphans_approval_rules_spec.rb spec/migrations/set_email_confirmation_setting_from_soft_email_confirmation_ff_spec.rb spec/migrations/recount_epic_cache_counts_v3_spec.rb spec/migrations/20230202211434_migrate_redis_slot_keys_spec.rb spec/migrations/ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb spec/migrations/20230306195007_queue_backfill_project_wiki_repositories_spec.rb spec/migrations/20230309071242_delete_security_policy_bot_users_spec.rbKnapsack report generator started!917Run options: exclude {:quarantine=>true, :zoekt=>true}918Test environment set up in 1.977053141 seconds919SyncNewAmountUsedForCiProjectMonthlyUsages920 # order random921main: == 20221011062254 SyncNewAmountUsedForCiProjectMonthlyUsages: migrating =======922main: == 20221011062254 SyncNewAmountUsedForCiProjectMonthlyUsages: migrated (0.0128s) 923 updates `new_amount_used` with values from `amount_used`924SchedulePurgingStaleSecurityScans925 when the migration does not run on GitLab.com or `dev_or_test_env`926main: == 20220407163559 SchedulePurgingStaleSecurityScans: migrating ================927main: == 20220407163559 SchedulePurgingStaleSecurityScans: migrated (0.0005s) =======928 does not run the migration929 when the migration runs on GitLab.com930 behaves like schedules the background jobs931main: == 20220407163559 SchedulePurgingStaleSecurityScans: migrating ================932main: -- Scheduled 2 PurgeStaleSecurityScans jobs with a maximum of 1 records per batch and an interval of 120 seconds.933The migration is expected to take at least 240 seconds. Expect all jobs to have completed after 2023-03-30 11:44:56 UTC."934main: == 20220407163559 SchedulePurgingStaleSecurityScans: migrated (0.0468s) =======935 creates 2 jobs936 when the migration runs on dev or test env937 behaves like schedules the background jobs938main: == 20220407163559 SchedulePurgingStaleSecurityScans: migrating ================939main: -- Scheduled 2 PurgeStaleSecurityScans jobs with a maximum of 1 records per batch and an interval of 120 seconds.940The migration is expected to take at least 240 seconds. Expect all jobs to have completed after 2023-03-30 11:44:57 UTC."941main: == 20220407163559 SchedulePurgingStaleSecurityScans: migrated (0.0407s) =======942 creates 2 jobs943AddInsertOrUpdateVulnerabilityReadsTrigger944 #up945 UPDATE trigger946 when vulnerability_id is updated947main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrating =======948main: -- execute("CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()\nRETURNS TRIGGER\nLANGUAGE plpgsql\nAS $$\nDECLARE\n severity smallint;\n state smallint;\n report_type smallint;\n resolved_on_default_branch boolean;\nBEGIN\n IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN\n RETURN NULL;\n END IF;\n\n IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN\n RETURN NULL;\n END IF;\n\n SELECT\n vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch\n INTO\n severity, state, report_type, resolved_on_default_branch\n FROM\n vulnerabilities\n WHERE\n vulnerabilities.id = NEW.vulnerability_id;\n\n INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)\n VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')\n ON CONFLICT(vulnerability_id) DO NOTHING;\n RETURN NULL;\nEND\n$$;\n")949main: -> 0.0020s950main: -- execute("CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences\nAFTER INSERT OR UPDATE ON vulnerability_occurrences\nFOR EACH ROW\nEXECUTE PROCEDURE insert_or_update_vulnerability_reads();\n")951main: -> 0.0012s952main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrated (0.0034s) 953 creates a new vulnerability_reads row954 when vulnerability_id is not updated955main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrating =======956main: -- execute("CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()\nRETURNS TRIGGER\nLANGUAGE plpgsql\nAS $$\nDECLARE\n severity smallint;\n state smallint;\n report_type smallint;\n resolved_on_default_branch boolean;\nBEGIN\n IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN\n RETURN NULL;\n END IF;\n\n IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN\n RETURN NULL;\n END IF;\n\n SELECT\n vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch\n INTO\n severity, state, report_type, resolved_on_default_branch\n FROM\n vulnerabilities\n WHERE\n vulnerabilities.id = NEW.vulnerability_id;\n\n INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)\n VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')\n ON CONFLICT(vulnerability_id) DO NOTHING;\n RETURN NULL;\nEND\n$$;\n")957main: -> 0.0025s958main: -- execute("CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences\nAFTER INSERT OR UPDATE ON vulnerability_occurrences\nFOR EACH ROW\nEXECUTE PROCEDURE insert_or_update_vulnerability_reads();\n")959main: -> 0.0014s960main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrated (0.0040s) 961 does not create a new vulnerability_reads row962 INSERT trigger963 when vulnerability_id is set964main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrating =======965main: -- execute("CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()\nRETURNS TRIGGER\nLANGUAGE plpgsql\nAS $$\nDECLARE\n severity smallint;\n state smallint;\n report_type smallint;\n resolved_on_default_branch boolean;\nBEGIN\n IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN\n RETURN NULL;\n END IF;\n\n IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN\n RETURN NULL;\n END IF;\n\n SELECT\n vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch\n INTO\n severity, state, report_type, resolved_on_default_branch\n FROM\n vulnerabilities\n WHERE\n vulnerabilities.id = NEW.vulnerability_id;\n\n INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)\n VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')\n ON CONFLICT(vulnerability_id) DO NOTHING;\n RETURN NULL;\nEND\n$$;\n")966main: -> 0.0026s967main: -- execute("CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences\nAFTER INSERT OR UPDATE ON vulnerability_occurrences\nFOR EACH ROW\nEXECUTE PROCEDURE insert_or_update_vulnerability_reads();\n")968main: -> 0.0014s969main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrated (0.0042s) 970 creates a new vulnerability_reads row971 when vulnerability_id is not set972main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrating =======973main: -- execute("CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()\nRETURNS TRIGGER\nLANGUAGE plpgsql\nAS $$\nDECLARE\n severity smallint;\n state smallint;\n report_type smallint;\n resolved_on_default_branch boolean;\nBEGIN\n IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN\n RETURN NULL;\n END IF;\n\n IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN\n RETURN NULL;\n END IF;\n\n SELECT\n vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch\n INTO\n severity, state, report_type, resolved_on_default_branch\n FROM\n vulnerabilities\n WHERE\n vulnerabilities.id = NEW.vulnerability_id;\n\n INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)\n VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')\n ON CONFLICT(vulnerability_id) DO NOTHING;\n RETURN NULL;\nEND\n$$;\n")974main: -> 0.0024s975main: -- execute("CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences\nAFTER INSERT OR UPDATE ON vulnerability_occurrences\nFOR EACH ROW\nEXECUTE PROCEDURE insert_or_update_vulnerability_reads();\n")976main: -> 0.0012s977main: == 20220106111958 AddInsertOrUpdateVulnerabilityReadsTrigger: migrated (0.0038s) 978 does not create a new vulnerability_reads row979 #down980main: -- execute("CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads()\nRETURNS TRIGGER\nLANGUAGE plpgsql\nAS $$\nDECLARE\n severity smallint;\n state smallint;\n report_type smallint;\n resolved_on_default_branch boolean;\nBEGIN\n IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN\n RETURN NULL;\n END IF;\n\n IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN\n RETURN NULL;\n END IF;\n\n SELECT\n vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch\n INTO\n severity, state, report_type, resolved_on_default_branch\n FROM\n vulnerabilities\n WHERE\n vulnerabilities.id = NEW.vulnerability_id;\n\n INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)\n VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')\n ON CONFLICT(vulnerability_id) DO NOTHING;\n RETURN NULL;\nEND\n$$;\n")981main: -> 0.0019s982main: -- execute("CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences\nAFTER INSERT OR UPDATE ON vulnerability_occurrences\nFOR EACH ROW\nEXECUTE PROCEDURE insert_or_update_vulnerability_reads();\n")983main: -> 0.0014s984main: -- execute("DROP TRIGGER IF EXISTS trigger_insert_or_update_vulnerability_reads_from_occurrences ON vulnerability_occurrences")985main: -> 0.0012s986main: -- execute("DROP FUNCTION IF EXISTS insert_or_update_vulnerability_reads()")987main: -> 0.0011s988 drops the trigger989RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures990main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features"})991main: -> 0.0328s992main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features_old"})993main: -> 0.0307s994main: == 20220224204415 RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures: migrating 995main: -- rename_index("ci_builds", "index_security_ci_builds_on_name_and_id_parser_features", "index_security_ci_builds_on_name_and_id_parser_features_old")996main: -> 0.0012s997main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features", :where=>"(name::text = ANY (ARRAY['container_scanning'::character varying::text,\n 'dast'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'license_management'::character varying::text,\n 'sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'coverage_fuzzing'::character varying::text,\n 'license_scanning'::character varying::text,\n 'apifuzzer_fuzz'::character varying::text,\n 'apifuzzer_fuzz_dnd'::character varying::text])\n ) AND type::text = 'Ci::Build'::text", :algorithm=>:concurrently})998main: -> 0.0303s999main: -- add_index_options("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features", :where=>"(name::text = ANY (ARRAY['container_scanning'::character varying::text,\n 'dast'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'license_management'::character varying::text,\n 'sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'coverage_fuzzing'::character varying::text,\n 'license_scanning'::character varying::text,\n 'apifuzzer_fuzz'::character varying::text,\n 'apifuzzer_fuzz_dnd'::character varying::text])\n ) AND type::text = 'Ci::Build'::text", :algorithm=>:concurrently})1000main: -> 0.0001s1001main: == 20220224204415 RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures: migrated (0.0489s) 1002main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features"})1003main: -> 0.0293s1004main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features_old"})1005main: -> 0.0294s1006main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features"})1007main: -> 0.0309s1008main: -- index_exists?("ci_builds", [:name, :id], {:name=>"index_security_ci_builds_on_name_and_id_parser_features_old"})1009main: -> 0.0316s1010 recreates index1011UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault1012 with no rows in the application_settings table1013main: == 20220215164709 UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault: migrating 1014main: -- change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, {:from=>0, :to=>4})1015main: -> 0.1525s1016main: == 20220215164709 UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault: migrated (0.1694s) 1017 does not insert a row1018 with a row in the application_settings table1019 with container_registry_expiration_policy_worker_capacity set to a value different than 01020main: == 20220215164709 UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault: migrating 1021main: -- change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, {:from=>0, :to=>4})1022main: -> 0.1831s1023main: == 20220215164709 UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault: migrated (0.3668s) 1024 does not update the row1025 with container_registry_expiration_policy_worker_capacity set to 01026main: == 20220215164709 UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault: migrating 1027main: -- change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, {:from=>0, :to=>4})1028main: -> 0.1472s1029main: == 20220215164709 UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault: migrated (0.3370s) 1030 updates the existing row1031RemoveWikiNotes1032main: == 20220322094410 RemoveWikiNotes: migrating ==================================1033main: == 20220322094410 RemoveWikiNotes: migrated (0.0060s) =========================1034 removes all wiki notes1035 when not staging nor com1036main: == 20220322094410 RemoveWikiNotes: migrating ==================================1037main: == 20220322094410 RemoveWikiNotes: migrated (0.0004s) =========================1038 does not remove notes1039BackfillIncidentIssueEscalationStatuses1040 # order random1041main: == 20211214012507 BackfillIncidentIssueEscalationStatuses: migrating ==========1042main: == 20211214012507 BackfillIncidentIssueEscalationStatuses: migrated (0.0000s) =1043 does nothing1044RemoveInvalidIntegrations1045 #up1046main: == 20220607140222 RemoveInvalidIntegrations: migrating ========================1047main: == 20220607140222 RemoveInvalidIntegrations: migrated (0.0060s) ===============1048 removes invalid integrations1049 when there are many invalid integrations1050main: == 20220607140222 RemoveInvalidIntegrations: migrating ========================1051main: == 20220607140222 RemoveInvalidIntegrations: migrated (0.0148s) ===============1052 removes them all1053The application_settings (main) table has 1226 columns.1054Recreating the database1055Dropped database 'gitlabhq_test'1056Created database 'gitlabhq_test'1057Databases re-creation done in 6.0657424109995191058UpdatePagesOnboardingState1059 #up1060 sets the onboarding_complete attribute to the value of deployed1061 #down1062 sets all onboarding_complete attributes to false1063ScheduleMergeTopicsWithSameName1064 #up1065main: == 20220223124428 ScheduleMergeTopicsWithSameName: migrating ==================1066main: == 20220223124428 ScheduleMergeTopicsWithSameName: migrated (0.0112s) =========1067 schedules MergeTopicsWithSameName background jobs1068AddUserIdAndIpAddressSuccessIndexToAuthenticationEvents1069main: == 20220601152916 AddUserIdAndIpAddressSuccessIndexToAuthenticationEvents: migrating 1070main: -- view_exists?(:postgres_partitions)1071main: -> 0.0017s1072main: -- index_exists?(:authentication_events, [:user_id, :ip_address, :result], {:name=>"index_authentication_events_on_user_and_ip_address_and_result", :algorithm=>:concurrently})1073main: -> 0.0066s1074main: -- add_index(:authentication_events, [:user_id, :ip_address, :result], {:name=>"index_authentication_events_on_user_and_ip_address_and_result", :algorithm=>:concurrently})1075main: -> 0.0021s1076main: -- view_exists?(:postgres_partitions)1077main: -> 0.0015s1078main: -- indexes(:authentication_events)1079main: -> 0.0069s1080main: -- remove_index(:authentication_events, {:algorithm=>:concurrently, :name=>"index_authentication_events_on_user_id"})1081main: -> 0.0015s1082main: == 20220601152916 AddUserIdAndIpAddressSuccessIndexToAuthenticationEvents: migrated (0.0500s) 1083 correctly migrates up and down1084UpdateDefaultScanMethodOfDastSiteProfile1085main: == 20220208171826 UpdateDefaultScanMethodOfDastSiteProfile: migrating =========1086main: -- execute("UPDATE dast_site_profiles\nSET scan_method = 1\nWHERE id BETWEEN 2 AND 2\n")1087main: -> 0.0014s1088main: == 20220208171826 UpdateDefaultScanMethodOfDastSiteProfile: migrated (0.0162s) 1089 updates the scan_method to 1 for profiles with target_type 11090ScheduleDisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects1091 when on gitlab.com1092 #up1093main: == 20220721031446 ScheduleDisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects: migrating 1094main: == 20220721031446 ScheduleDisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects: migrated (0.0607s) 1095 schedules background jobs for each batch of projects1096 #down1097main: == 20220721031446 ScheduleDisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects: migrating 1098main: == 20220721031446 ScheduleDisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects: migrated (0.0532s) 1099 deletes all batched migration records1100 when on self-managed instance1101 #up1102 does not schedule background job1103 #down1104 does not delete background job1105ScheduleRemoveSelfManagedWikiNotes1106main: == 20220601110011 ScheduleRemoveSelfManagedWikiNotes: migrating ===============1107main: == 20220601110011 ScheduleRemoveSelfManagedWikiNotes: migrated (0.0707s) ======1108 schedules new batched migration1109 with com? or staging?1110main: == 20220601110011 ScheduleRemoveSelfManagedWikiNotes: migrating ===============1111main: == 20220601110011 ScheduleRemoveSelfManagedWikiNotes: migrated (0.0005s) ======1112 does not schedule new batched migration1113BackfillProjectStatisticsWithContainerRegistrySize1114main: == 20220622080547 BackfillProjectStatisticsWithContainerRegistrySize: migrating 1115main: == 20220622080547 BackfillProjectStatisticsWithContainerRegistrySize: migrated (0.0005s) 1116 does not schedule background jobs when Gitlab.com is false1117main: == 20220622080547 BackfillProjectStatisticsWithContainerRegistrySize: migrating 1118main: == 20220622080547 BackfillProjectStatisticsWithContainerRegistrySize: migrated (0.0512s) 1119 schedules background jobs for each batch of container_repository1120RemoveDuplicateProjectTagReleases1121 #up1122main: == 20220307192610 RemoveDuplicateProjectTagReleases: migrating ================1123main: == 20220307192610 RemoveDuplicateProjectTagReleases: migrated (0.0144s) =======1124 correctly removes duplicate tags from the same project1125AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences1126main: == 20220606082910 AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences: migrating 1127main: -- index_exists?(:vulnerability_occurrences, [:id, :scanner_id], {:where=>"report_type IN (7,99)", :name=>"tmp_index_vulnerability_occurrences_on_id_and_scanner_id", :algorithm=>:concurrently})1128main: -> 0.0099s1129main: -- add_index_options(:vulnerability_occurrences, [:id, :scanner_id], {:where=>"report_type IN (7,99)", :name=>"tmp_index_vulnerability_occurrences_on_id_and_scanner_id", :algorithm=>:concurrently})1130main: -> 0.0001s1131main: == 20220606082910 AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences: migrated (0.0282s) 1132 schedules the index1133The application_settings (main) table has 1232 columns.1134Recreating the database1135Dropped database 'gitlabhq_test'1136Created database 'gitlabhq_test'1137Databases re-creation done in 4.8299975439995251138MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema1139 # order random1140 #down1141 when there is a partition1142main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrating 1143main: -- execute("LOCK TABLE vulnerability_scanners, security_scans, security_findings IN ACCESS EXCLUSIVE MODE\n")1144main: -> 0.0015s1145main: -- execute("SELECT\n pg_get_constraintdef(pg_catalog.pg_constraint.oid)\nFROM\n pg_catalog.pg_constraint\nINNER JOIN pg_class ON pg_class.oid = pg_catalog.pg_constraint.conrelid\nWHERE\n conname = 'check_partition_number' AND\n pg_class.relname = 'security_findings'\n")1146main: -> 0.0017s1147main: -- execute("ALTER TABLE security_findings RENAME TO security_findings_1;\n")1148main: -> 0.0010s1149main: -- execute("ALTER INDEX security_findings_pkey RENAME TO security_findings_1_pkey;\n")1150main: -> 0.0010s1151main: -- execute("CREATE TABLE security_findings (\n LIKE security_findings_1 INCLUDING ALL\n) PARTITION BY LIST (partition_number);\n")1152main: -> 0.0039s1153main: -- execute("ALTER SEQUENCE security_findings_id_seq OWNED BY public.security_findings.id;\n")1154main: -> 0.0009s1155main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;\n")1156main: -> 0.0013s1157main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE;\n")1158main: -> 0.0015s1159main: -- execute("ALTER TABLE security_findings_1 SET SCHEMA gitlab_partitions_dynamic;\n")1160main: -> 0.0011s1161main: -- execute("ALTER TABLE security_findings ATTACH PARTITION gitlab_partitions_dynamic.security_findings_1 FOR VALUES IN (1);\n")1162main: -> 0.0026s1163main: -- execute("ALTER TABLE security_findings DROP CONSTRAINT check_partition_number;\n")1164main: -> 0.0011s1165main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_unique_columns RENAME TO security_findings_1_uuid_scan_id_partition_number_idx;\n")1166main: -> 0.0010s1167main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_confidence RENAME TO security_findings_1_confidence_idx;\n")1168main: -> 0.0014s1169main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_project_fingerprint RENAME TO security_findings_1_project_fingerprint_idx;\n")1170main: -> 0.0010s1171main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_deduplicated RENAME TO security_findings_1_scan_id_deduplicated_idx;\n")1172main: -> 0.0009s1173main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_id RENAME TO security_findings_1_scan_id_id_idx;\n")1174main: -> 0.0009s1175main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scanner_id RENAME TO security_findings_1_scanner_id_idx;\n")1176main: -> 0.0014s1177main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_severity RENAME TO security_findings_1_severity_idx;\n")1178main: -> 0.0009s1179main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrated (0.0322s) 1180WARNING: Active Record does not support composite primary key.1181security_findings has composite primary key. Composite primary key is ignored.1182 creates the original table with the data from the existing partition1183 when there are more than one partitions1184main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrating 1185main: -- execute("LOCK TABLE vulnerability_scanners, security_scans, security_findings IN ACCESS EXCLUSIVE MODE\n")1186main: -> 0.0010s1187main: -- execute("SELECT\n pg_get_constraintdef(pg_catalog.pg_constraint.oid)\nFROM\n pg_catalog.pg_constraint\nINNER JOIN pg_class ON pg_class.oid = pg_catalog.pg_constraint.conrelid\nWHERE\n conname = 'check_partition_number' AND\n pg_class.relname = 'security_findings'\n")1188main: -> 0.0017s1189main: -- execute("ALTER TABLE security_findings RENAME TO security_findings_1;\n")1190main: -> 0.0011s1191main: -- execute("ALTER INDEX security_findings_pkey RENAME TO security_findings_1_pkey;\n")1192main: -> 0.0009s1193main: -- execute("CREATE TABLE security_findings (\n LIKE security_findings_1 INCLUDING ALL\n) PARTITION BY LIST (partition_number);\n")1194main: -> 0.0032s1195main: -- execute("ALTER SEQUENCE security_findings_id_seq OWNED BY public.security_findings.id;\n")1196main: -> 0.0010s1197main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;\n")1198main: -> 0.0013s1199main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE;\n")1200main: -> 0.0012s1201main: -- execute("ALTER TABLE security_findings_1 SET SCHEMA gitlab_partitions_dynamic;\n")1202main: -> 0.0012s1203main: -- execute("ALTER TABLE security_findings ATTACH PARTITION gitlab_partitions_dynamic.security_findings_1 FOR VALUES IN (1);\n")1204main: -> 0.0025s1205main: -- execute("ALTER TABLE security_findings DROP CONSTRAINT check_partition_number;\n")1206main: -> 0.0012s1207main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_unique_columns RENAME TO security_findings_1_uuid_scan_id_partition_number_idx;\n")1208main: -> 0.0009s1209main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_confidence RENAME TO security_findings_1_confidence_idx;\n")1210main: -> 0.0009s1211main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_project_fingerprint RENAME TO security_findings_1_project_fingerprint_idx;\n")1212main: -> 0.0009s1213main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_deduplicated RENAME TO security_findings_1_scan_id_deduplicated_idx;\n")1214main: -> 0.0010s1215main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_id RENAME TO security_findings_1_scan_id_id_idx;\n")1216main: -> 0.0010s1217main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scanner_id RENAME TO security_findings_1_scanner_id_idx;\n")1218main: -> 0.0010s1219main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_severity RENAME TO security_findings_1_severity_idx;\n")1220main: -> 0.0009s1221main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrated (0.0298s) 1222WARNING: Active Record does not support composite primary key.1223security_findings has composite primary key. Composite primary key is ignored.1224 creates the original table from the latest existing partition1225 when there is no partition1226main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrating 1227main: -- execute("LOCK TABLE vulnerability_scanners, security_scans, security_findings IN ACCESS EXCLUSIVE MODE\n")1228main: -> 0.0010s1229main: -- execute("SELECT\n pg_get_constraintdef(pg_catalog.pg_constraint.oid)\nFROM\n pg_catalog.pg_constraint\nINNER JOIN pg_class ON pg_class.oid = pg_catalog.pg_constraint.conrelid\nWHERE\n conname = 'check_partition_number' AND\n pg_class.relname = 'security_findings'\n")1230main: -> 0.0017s1231main: -- execute("ALTER TABLE security_findings RENAME TO security_findings_11;\n")1232main: -> 0.0013s1233main: -- execute("ALTER INDEX security_findings_pkey RENAME TO security_findings_11_pkey;\n")1234main: -> 0.0009s1235main: -- execute("CREATE TABLE security_findings (\n LIKE security_findings_11 INCLUDING ALL\n) PARTITION BY LIST (partition_number);\n")1236main: -> 0.0031s1237main: -- execute("ALTER SEQUENCE security_findings_id_seq OWNED BY public.security_findings.id;\n")1238main: -> 0.0009s1239main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;\n")1240main: -> 0.0013s1241main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE;\n")1242main: -> 0.0012s1243main: -- execute("ALTER TABLE security_findings_11 SET SCHEMA gitlab_partitions_dynamic;\n")1244main: -> 0.0012s1245main: -- execute("ALTER TABLE security_findings ATTACH PARTITION gitlab_partitions_dynamic.security_findings_11 FOR VALUES IN (11);\n")1246main: -> 0.0025s1247main: -- execute("ALTER TABLE security_findings DROP CONSTRAINT check_partition_number;\n")1248main: -> 0.0012s1249main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_unique_columns RENAME TO security_findings_1_uuid_scan_id_partition_number_idx;\n")1250main: -> 0.0009s1251main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_confidence RENAME TO security_findings_1_confidence_idx;\n")1252main: -> 0.0009s1253main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_project_fingerprint RENAME TO security_findings_1_project_fingerprint_idx;\n")1254main: -> 0.0009s1255main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_deduplicated RENAME TO security_findings_1_scan_id_deduplicated_idx;\n")1256main: -> 0.0010s1257main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_id RENAME TO security_findings_1_scan_id_id_idx;\n")1258main: -> 0.0008s1259main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scanner_id RENAME TO security_findings_1_scanner_id_idx;\n")1260main: -> 0.0008s1261main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_severity RENAME TO security_findings_1_severity_idx;\n")1262main: -> 0.0008s1263main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrated (0.0293s) 1264 creates the original table1265 #up1266main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrating 1267main: -- execute("LOCK TABLE vulnerability_scanners, security_scans, security_findings IN ACCESS EXCLUSIVE MODE\n")1268main: -> 0.0013s1269main: -- execute("SELECT\n pg_get_constraintdef(pg_catalog.pg_constraint.oid)\nFROM\n pg_catalog.pg_constraint\nINNER JOIN pg_class ON pg_class.oid = pg_catalog.pg_constraint.conrelid\nWHERE\n conname = 'check_partition_number' AND\n pg_class.relname = 'security_findings'\n")1270main: -> 0.0022s1271main: -- execute("ALTER TABLE security_findings RENAME TO security_findings_1;\n")1272main: -> 0.0010s1273main: -- execute("ALTER INDEX security_findings_pkey RENAME TO security_findings_1_pkey;\n")1274main: -> 0.0010s1275main: -- execute("CREATE TABLE security_findings (\n LIKE security_findings_1 INCLUDING ALL\n) PARTITION BY LIST (partition_number);\n")1276main: -> 0.0034s1277main: -- execute("ALTER SEQUENCE security_findings_id_seq OWNED BY public.security_findings.id;\n")1278main: -> 0.0010s1279main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;\n")1280main: -> 0.0013s1281main: -- execute("ALTER TABLE security_findings\nADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE;\n")1282main: -> 0.0012s1283main: -- execute("ALTER TABLE security_findings_1 SET SCHEMA gitlab_partitions_dynamic;\n")1284main: -> 0.0014s1285main: -- execute("ALTER TABLE security_findings ATTACH PARTITION gitlab_partitions_dynamic.security_findings_1 FOR VALUES IN (1);\n")1286main: -> 0.0025s1287main: -- execute("ALTER TABLE security_findings DROP CONSTRAINT check_partition_number;\n")1288main: -> 0.0011s1289main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_unique_columns RENAME TO security_findings_1_uuid_scan_id_partition_number_idx;\n")1290main: -> 0.0009s1291main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_confidence RENAME TO security_findings_1_confidence_idx;\n")1292main: -> 0.0010s1293main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_project_fingerprint RENAME TO security_findings_1_project_fingerprint_idx;\n")1294main: -> 0.0009s1295main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_deduplicated RENAME TO security_findings_1_scan_id_deduplicated_idx;\n")1296main: -> 0.0009s1297main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scan_id_and_id RENAME TO security_findings_1_scan_id_id_idx;\n")1298main: -> 0.0009s1299main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_scanner_id RENAME TO security_findings_1_scanner_id_idx;\n")1300main: -> 0.0010s1301main: -- execute("ALTER INDEX gitlab_partitions_dynamic.index_security_findings_on_severity RENAME TO security_findings_1_severity_idx;\n")1302main: -> 0.0009s1303main: == 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrated (0.0313s) 1304 changes the `security_findings` table to be partitioned1305OrphanedInvitedMembersCleanup1306 # order random1307 #up1308main: == 20220830061704 OrphanedInvitedMembersCleanup: migrating ====================1309main: == 20220830061704 OrphanedInvitedMembersCleanup: migrated (0.0182s) ===========1310 removes accepted members with no associated user1311QueueBackfillProjectFeaturePackageRegistryAccessLevel1312main: == 20220602070502 QueueBackfillProjectFeaturePackageRegistryAccessLevel: migrating 1313main: == 20220602070502 QueueBackfillProjectFeaturePackageRegistryAccessLevel: migrated (0.0510s) 1314 schedules a new batched migration1315ScheduleBackfillNamespaceDetails1316 # order random1317 when on gitlab.com1318 #up1319 schedules background jobs for each batch of projects1320 #down1321 deletes all batched migration records1322UpdateJiraTrackerDataDeploymentTypeBasedOnUrl1323main: == 20220725150127 UpdateJiraTrackerDataDeploymentTypeBasedOnUrl: migrating ====1324main: -- Scheduling UpdateJiraTrackerDataDeploymentTypeBasedOnUrl jobs1325main: == 20220725150127 UpdateJiraTrackerDataDeploymentTypeBasedOnUrl: migrated (0.0457s) 1326 schedules background migration1327AddDefaultPreferredLanguageToApplicationSettings1328 # order random1329 #down1330main: == 20221101032521 AddDefaultPreferredLanguageToApplicationSettings: migrating =1331main: -- add_column(:application_settings, :default_preferred_language, :text, {:default=>"en", :null=>false})1332main: -> 0.0047s1333main: == 20221101032521 AddDefaultPreferredLanguageToApplicationSettings: migrated (0.0052s) 1334 deletes default_preferred_language field1335 #up1336main: == 20221101032521 AddDefaultPreferredLanguageToApplicationSettings: migrating =1337main: -- add_column(:application_settings, :default_preferred_language, :text, {:default=>"en", :null=>false})1338main: -> 0.0046s1339main: == 20221101032521 AddDefaultPreferredLanguageToApplicationSettings: migrated (0.0050s) 1340 allows to read default_preferred_language field1341DeleteQueuedJobsForVulnerabilitiesFeedbackMigration1342 # order random1343 #up1344 deletes all batched migration records13461st Try error in ./spec/migrations/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration_spec.rb:25:1347expected: 11348 got: 131349(compared using ==)1351RSpec::Retry: 2nd try ./spec/migrations/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration_spec.rb:251352DeleteOrphansApprovalRules1353 # order random1354 #up1355main: == 20221110152133 DeleteOrphansApprovalRules: migrating =======================1356main: == 20221110152133 DeleteOrphansApprovalRules: migrated (0.0908s) ==============1357 schedules background migration for both levels of approval rules1358SetEmailConfirmationSettingFromSoftEmailConfirmationFf1359 # order random1360 #down1361 updates 'email_confirmation_setting' to default value: '0' (off)1362 #up1363 when feature gate for `soft_email_confirmation` does not exist1364 does not update `email_confirmation_setting`1365 when feature gate for `soft_email_confirmation` does exist1366 when feature gate value is `false`1367 does not update `email_confirmation_setting`1368 when feature gate value is `true`1369 updates `email_confirmation_setting` to '1' (soft)1370RecountEpicCacheCountsV31371 # order random1372 #up1373main: == 20230209131808 RecountEpicCacheCountsV3: migrating =========================1374main: == 20230209131808 RecountEpicCacheCountsV3: migrated (0.0616s) ================1375 schedules a batched background migration1376 #down1377main: == 20230209131808 RecountEpicCacheCountsV3: migrating =========================1378main: == 20230209131808 RecountEpicCacheCountsV3: migrated (0.0501s) ================1379 deletes all batched migration records1380MigrateRedisSlotKeys1381 # order random1382 #up1383main: == 20230202211434 MigrateRedisSlotKeys: migrating =============================1384main: == 20230202211434 MigrateRedisSlotKeys: migrated (0.0425s) ====================1385 rename keys1386EnsureTimelogsNoteIdBigintBackfillIsFinishedForGitlabDotCom1387 # order random1388 #up1389main: == 20230228021910 EnsureTimelogsNoteIdBigintBackfillIsFinishedForGitlabDotCom: migrating 1390main: == 20230228021910 EnsureTimelogsNoteIdBigintBackfillIsFinishedForGitlabDotCom: migrated (0.0078s) 1391 ensures the migration is completed for GitLab.com, dev, or test1392main: == 20230228021910 EnsureTimelogsNoteIdBigintBackfillIsFinishedForGitlabDotCom: migrating 1393main: == 20230228021910 EnsureTimelogsNoteIdBigintBackfillIsFinishedForGitlabDotCom: migrated (0.0078s) 1394 skips the check for other instances1395AddTmpPartialIndexOnVulnerabilityReportTypes1396 # order random1397main: == 20230221093533 AddTmpPartialIndexOnVulnerabilityReportTypes: migrating =====1398main: -- index_exists?(:vulnerability_occurrences, :id, {:where=>"report_type IN (7, 99)", :name=>"tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99", :algorithm=>:concurrently})1399main: -> 0.0100s1400main: -- add_index_options(:vulnerability_occurrences, :id, {:where=>"report_type IN (7, 99)", :name=>"tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99", :algorithm=>:concurrently})1401main: -> 0.0001s1402main: == 20230221093533 AddTmpPartialIndexOnVulnerabilityReportTypes: migrated (0.0379s) 1403 schedules the index1404QueueBackfillProjectWikiRepositories1405 # order random1406main: == 20230306195007 QueueBackfillProjectWikiRepositories: migrating =============1407main: == 20230306195007 QueueBackfillProjectWikiRepositories: migrated (0.0540s) ====1408 schedules a new batched migration1409DeleteSecurityPolicyBotUsers1410 # order random1411 #up1412main: == 20230309071242 DeleteSecurityPolicyBotUsers: migrating =====================1413main: == 20230309071242 DeleteSecurityPolicyBotUsers: migrated (0.0332s) ============1414 deletes security_policy_bot users1415Knapsack report was generated. Preview:1416{1417 "spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb": 17.29361126099957,1418 "spec/migrations/schedule_purging_stale_security_scans_spec.rb": 28.856934370999625,1419 "spec/migrations/20220106111958_add_insert_or_update_vulnerability_reads_trigger_spec.rb": 34.166721982000126,1420 "spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb": 27.436379118000332,1421 "spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb": 31.211336773999392,1422 "spec/migrations/remove_wiki_notes_spec.rb": 27.30076886900042,1423 "spec/migrations/20211214012507_backfill_incident_issue_escalation_statuses_spec.rb": 31.16964683600054,1424 "spec/migrations/remove_invalid_integrations_spec.rb": 23.69206964300065,1425 "spec/migrations/20220322132242_update_pages_onboarding_state_spec.rb": 27.597172035999392,1426 "spec/migrations/20220223124428_schedule_merge_topics_with_same_name_spec.rb": 27.09765739500017,1427 "spec/migrations/20220601152916_add_user_id_and_ip_address_success_index_to_authentication_events_spec.rb": 23.935907885000233,1428 "spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb": 26.334007672000553,1429 "spec/migrations/20220721031446_schedule_disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb": 21.39991790699969,1430 "spec/migrations/20220601110011_schedule_remove_self_managed_wiki_notes_spec.rb": 23.19252594000045,1431 "spec/migrations/20220622080547_backfill_project_statistics_with_container_registry_size_spec.rb": 22.77936551199946,1432 "spec/migrations/20220307192610_remove_duplicate_project_tag_releases_spec.rb": 25.73795042799975,1433 "spec/migrations/20220606082910_add_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb": 21.4158906950006,1434 "spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb": 20.321838288000436,1435 "spec/migrations/orphaned_invited_members_cleanup_spec.rb": 16.554490014000294,1436 "spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb": 21.661158927000542,1437 "spec/migrations/20220921093355_schedule_backfill_namespace_details_spec.rb": 16.08329683000011,1438 "spec/migrations/20220725150127_update_jira_tracker_data_deployment_type_based_on_url_spec.rb": 18.815454262999992,1439 "spec/migrations/20221101032521_add_default_preferred_language_to_application_settings_spec.rb": 16.285674463999385,1440 "spec/migrations/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration_spec.rb": 11.725018410999837,1441 "spec/migrations/20221110152133_delete_orphans_approval_rules_spec.rb": 12.892858442000033,1442 "spec/migrations/set_email_confirmation_setting_from_soft_email_confirmation_ff_spec.rb": 7.324065734999749,1443 "spec/migrations/recount_epic_cache_counts_v3_spec.rb": 7.447879665000073,1444 "spec/migrations/20230202211434_migrate_redis_slot_keys_spec.rb": 6.621805548000339,1445 "spec/migrations/ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb": 5.92791534800017,1446 "spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb": 5.72176937399945,1447 "spec/migrations/20230306195007_queue_backfill_project_wiki_repositories_spec.rb": 3.899780706000456,1448 "spec/migrations/20230309071242_delete_security_policy_bot_users_spec.rb": 3.07473898500029461449}1450Knapsack global time execution for tests: 10m 14s1451Finished in 22 minutes 35 seconds (files took 46.51 seconds to load)145258 examples, 0 failures1453Randomized with seed 504031454[TEST PROF INFO] Time spent in factories: 00:00.529 (0.04% of total time)1455RSpec exited with 0.1456No examples to retry, congrats!1458Not uploading cache ruby-gems-debian-bullseye-ruby-3.0-16 due to policy1459Not uploading cache gitaly-ruby-gems-debian-bullseye-ruby-3.0-16 due to policy1461Uploading artifacts...1462coverage/: found 5 matching artifact files and directories 1463crystalball/: found 2 matching artifact files and directories 1464WARNING: deprecations/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/gitlab-org/gitlab) 1465knapsack/: found 3 matching artifact files and directories 1466WARNING: query_recorder/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/gitlab-org/gitlab) 1467rspec/: found 14 matching artifact files and directories 1468WARNING: tmp/capybara/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/gitlab-org/gitlab) 1469log/*.log: found 13 matching artifact files and directories 1470WARNING: Upload request redirected location=https://gitlab.com/api/v4/jobs/4031138378/artifacts?artifact_format=zip&artifact_type=archive&expire_in=31d new-url=https://gitlab.com1471WARNING: Retrying... context=artifacts-uploader error=request redirected1472Uploading artifacts as "archive" to coordinator... 201 Created id=4031138378 responseStatus=201 Created token=64_fFD9x1473Uploading artifacts...1474rspec/junit_rspec.xml: found 1 matching artifact files and directories 1475WARNING: Upload request redirected location=https://gitlab.com/api/v4/jobs/4031138378/artifacts?artifact_format=gzip&artifact_type=junit&expire_in=31d new-url=https://gitlab.com1476WARNING: Retrying... context=artifacts-uploader error=request redirected1477Uploading artifacts as "junit" to coordinator... 201 Created id=4031138378 responseStatus=201 Created token=64_fFD9x1479Job succeeded