Skip to content

Rebalance partition_id for ci_builds

Max Orefice requested to merge morefice/rebalance-partition-id-ci-builds into master

Ref: #387301 (closed)

What does this MR do and why?

Following up !109981 (merged)

This MR fixes invalid partition_id for ci_builds on gitlab.com.

It updates all invalid records in production and sets the partition_id to 100.

Database

I choose a default batch size of 5_000 and a sub batch size of 500 as suggested by @krasio as we have 1.5M records to fix.

📝 This seems to be the query executed by our background migration and its associated query plan.

UPDATE ci_builds
SET partition_id = 100
WHERE ci_builds.id BETWEEN 100000 AND 100500
AND ci_builds.partition_id = 101

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