Skip to content

Draft: Introduce ci_project_mirrors and ci_namespace_mirrors tables

Furkan Ayhan requested to merge 336432-ci-namespace-project-reflections into master

What does this MR do and why?

This MR is mostly inspired from !72033 (closed).

Related to #336432 (closed)

Example usage: !74900 (merged).

Database

Migrate up

== 20211011140930 CreateCiNamespaceMirrors: migrating =========================
-- create_table(:ci_namespace_mirrors, {:id=>false})
   -> 0.0242s
== 20211011140930 CreateCiNamespaceMirrors: migrated (0.0243s) ================

== 20211011140931 CreateCiProjectMirrors: migrating ===========================
-- create_table(:ci_project_mirrors, {:id=>false})
   -> 0.0102s
== 20211011140931 CreateCiProjectMirrors: migrated (0.0103s) ==================

== 20211011140932 CreateNamespacesSyncEvents: migrating =======================
-- create_table(:namespaces_sync_events, {})
   -> 0.0105s
== 20211011140932 CreateNamespacesSyncEvents: migrated (0.0106s) ==============

== 20211011141239 CreateProjectsSyncEvents: migrating =========================
-- create_table(:projects_sync_events, {})
   -> 0.0107s
== 20211011141239 CreateProjectsSyncEvents: migrated (0.0107s) ================

== 20211011141240 ScheduleBackfillCiNamespaceMirrors: migrating ===============
-- Scheduled 1 BackfillCiNamespaceMirrors jobs with a maximum of 1000 records per batch and an interval of 120 seconds.

The migration is expected to take at least 120 seconds. Expect all jobs to have completed after 2021-11-24 10:10:31 UTC."
== 20211011141240 ScheduleBackfillCiNamespaceMirrors: migrated (0.0946s) ======

== 20211011141241 ScheduleBackfillCiProjectMirrors: migrating =================
-- Scheduled 1 BackfillCiProjectMirrors jobs with a maximum of 1000 records per batch and an interval of 120 seconds.

The migration is expected to take at least 120 seconds. Expect all jobs to have completed after 2021-11-24 10:10:31 UTC."
== 20211011141241 ScheduleBackfillCiProjectMirrors: migrated (0.0680s) ========

Migrate down

== 20211011141240 ScheduleBackfillCiNamespaceMirrors: reverting ===============
== 20211011141240 ScheduleBackfillCiNamespaceMirrors: reverted (0.0000s) ======

== 20211011141241 ScheduleBackfillCiProjectMirrors: reverting =================
== 20211011141241 ScheduleBackfillCiProjectMirrors: reverted (0.0000s) ========

== 20211011141239 CreateProjectsSyncEvents: reverting =========================
-- drop_table(:projects_sync_events, {})
   -> 0.0140s
== 20211011141239 CreateProjectsSyncEvents: reverted (0.0169s) ================

== 20211011140932 CreateNamespacesSyncEvents: reverting =======================
-- drop_table(:namespaces_sync_events, {})
   -> 0.0040s
== 20211011140932 CreateNamespacesSyncEvents: reverted (0.0056s) ==============

== 20211011140931 CreateCiProjectMirrors: reverting ===========================
-- drop_table(:ci_project_mirrors, {:id=>false})
   -> 0.0039s
== 20211011140931 CreateCiProjectMirrors: reverted (0.0055s) ==================

== 20211011140930 CreateCiNamespaceMirrors: reverting =========================
-- drop_table(:ci_namespace_mirrors, {:id=>false})
   -> 0.0038s
== 20211011140930 CreateCiNamespaceMirrors: reverted (0.0053s) ================

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Furkan Ayhan

Merge request reports