Prepare ci_build_trace_sections for int8 migration
What does this MR do?
This prepares to migrate ci_build_trace_sections.build_id
to int8
. See #328432 (closed).
The caveat here is that we cannot batch on id
but only on build_id
. This means we're going to see a varying amount of records per update, which may lead to inconsistent timings along the way.
Migrations: up
== 20210430121522 InitializeConversionOfCiBuildTraceSectionsToBigint: migrating
-- table_exists?(:ci_build_trace_sections)
-> 0.0010s
-- column_exists?(:ci_build_trace_sections, :build_id)
-> 0.0008s
-- column_exists?(:ci_build_trace_sections, :build_id)
-> 0.0006s
-- columns(:ci_build_trace_sections)
-> 0.0006s
-- add_column(:ci_build_trace_sections, "build_id_convert_to_bigint", :bigint, {:default=>0, :null=>false})
-> 0.0012s
== 20210430121522 InitializeConversionOfCiBuildTraceSectionsToBigint: migrated (0.0120s)
== 20210430121542 BackfillCiBuildTraceSectionsForBigintConversion: migrating ==
-- table_exists?(:ci_build_trace_sections)
-> 0.0011s
-- column_exists?(:ci_build_trace_sections, :build_id)
-> 0.0009s
-- column_exists?(:ci_build_trace_sections, :build_id)
-> 0.0007s
-- column_exists?(:ci_build_trace_sections, "build_id_convert_to_bigint")
-> 0.0007s
unknown OID 28: failed to recognize type of 'relfrozenxid'. It will be treated as String.
unknown OID 1034: failed to recognize type of 'relacl'. It will be treated as String.
unknown OID 194: failed to recognize type of 'relpartbound'. It will be treated as String.
== 20210430121542 BackfillCiBuildTraceSectionsForBigintConversion: migrated (0.0417s)
Migrations: down
== 20210430121542 BackfillCiBuildTraceSectionsForBigintConversion: reverting ==
-- execute("DELETE FROM batched_background_migrations WHERE job_class_name = 'CopyColumnUsingBackgroundMigrationJob' AND table_name = 'ci_build_trace_sections' AND column_name = 'build_id' AND job_arguments = '[[\"build_id\"],[\"build_id_convert_to_bigint\"]]'")
-> 0.0017s
== 20210430121542 BackfillCiBuildTraceSectionsForBigintConversion: reverted (0.0018s)
== 20210430121522 InitializeConversionOfCiBuildTraceSectionsToBigint: reverting
-- remove_column(:ci_build_trace_sections, "build_id_convert_to_bigint")
-> 0.0007s
== 20210430121522 InitializeConversionOfCiBuildTraceSectionsToBigint: reverted (0.0030s)
Does this MR meet the acceptance criteria?
Conformity
-
I have included a changelog entry, or it's not needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Edited by Andreas Brandl