Skip to content

Add FK including partition_id to ci_builds_runner_session

Max Orefice requested to merge morefice/prepare-ci-builds-partitioning-fk-4 into master

Ref: #382033 (closed)

What does this MR do and why?

Step 4 to redefine FK referencing ci_builds.

This MR creates the following migrations to redefine our FK to include the partition_id in order to partition ci_builds.

It takes care of the following model.

  • Ci::BuildRunnerSession

And follow a simple strategy using only post migrations as this reference ci_builds a high-traffic table:

  1. Creates an index
  2. Creates the FK
  3. Do not validate the FK as it takes 4 hours, it will be done in a Change Request during low traffic over the weekend

This is a similar approach we implemented in !107476 (merged).

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 Max Orefice

Merge request reports