Skip to content

Remove original Terraform replication

Alex Ives requested to merge alexives/remove_original_tf_replication into master

What does this MR do?

Remove all of the things added to support the non-versioned terraform state replication.

This thing looks... daunting, but it is 95% deleting code. Only "added" code in the entire MR is a geo post-migration that removes the table from the geo secondary database. I'd really like to remove this whole thing at once.

This is effectively a revert of the non-framework portions of the following merge requests:

Database

Primary Database Migrations

Up:

== 20200928233632 RemoveTerraformStateVerificationIndexes: migrating ==========
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:terraform_states, :verification_failure, {:name=>"terraform_states_verification_failure_partial", :algorithm=>:concurrently})
   -> 0.0041s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- remove_index(:terraform_states, {:name=>"terraform_states_verification_failure_partial", :algorithm=>:concurrently, :column=>:verification_failure})
   -> 0.0057s
-- execute("RESET ALL")
   -> 0.0004s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:terraform_states, :verification_checksum, {:name=>"terraform_states_verification_checksum_partial", :algorithm=>:concurrently})
   -> 0.0022s
-- remove_index(:terraform_states, {:name=>"terraform_states_verification_checksum_partial", :algorithm=>:concurrently, :column=>:verification_checksum})
   -> 0.0030s
== 20200928233632 RemoveTerraformStateVerificationIndexes: migrated (0.0174s) =

Down:

== 20200928233632 RemoveTerraformStateVerificationIndexes: reverting ==========
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:terraform_states, :verification_failure, {:where=>"(verification_failure IS NOT NULL)", :name=>"terraform_states_verification_failure_partial", :algorithm=>:concurrently})
   -> 0.0031s
-- execute("SET statement_timeout TO 0")
   -> 0.0004s
-- add_index(:terraform_states, :verification_failure, {:where=>"(verification_failure IS NOT NULL)", :name=>"terraform_states_verification_failure_partial", :algorithm=>:concurrently})
   -> 0.0033s
-- execute("RESET ALL")
   -> 0.0004s
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:terraform_states, :verification_checksum, {:where=>"(verification_checksum IS NOT NULL)", :name=>"terraform_states_verification_checksum_partial", :algorithm=>:concurrently})
   -> 0.0019s
-- add_index(:terraform_states, :verification_checksum, {:where=>"(verification_checksum IS NOT NULL)", :name=>"terraform_states_verification_checksum_partial", :algorithm=>:concurrently})
   -> 0.0021s
== 20200928233632 RemoveTerraformStateVerificationIndexes: reverted (0.0124s) =

Geo Tracking Database Migrations

Up:

== 20200924184638 RemoveNonVersionedTerraformStateRegistry: migrating =========
-- drop_table(:terraform_state_registry)
   -> 0.0035s
== 20200924184638 RemoveNonVersionedTerraformStateRegistry: migrated (0.0035s) 

Down:

== 20200924184638 RemoveNonVersionedTerraformStateRegistry: reverting =========
-- table_exists?(:terraform_state_registry)
   -> 0.0005s
-- create_table(:terraform_state_registry, {:id=>:bigserial, :force=>:cascade})
   -> 0.0116s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE terraform_state_registry\nADD CONSTRAINT check_70a3f43f16\nCHECK ( char_length(last_sync_failure) <= 255 )\nNOT VALID;\n")
   -> 0.0017s
-- execute("ALTER TABLE terraform_state_registry VALIDATE CONSTRAINT check_70a3f43f16;")
   -> 0.0006s
== 20200924184638 RemoveNonVersionedTerraformStateRegistry: reverted (0.0233s) 

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Fixes #254623 (closed) Fixes #255951 (closed)

Edited by Alex Ives

Merge request reports