Skip to content

Fix partition_id for ci_job_artifacts

Max Orefice requested to merge morefice/fix-partition-id-ci-job-artifacts into master

Ref: #387301 (closed)

What does this MR do and why?

This MR fixes invalid ci_job_artifacts records in production and sets the partition_id to 100.

Database

We have around ~1.2M records to fix.

Following a similar strategy used in !111287 (merged), I choose a default batch size of 5_000 and a sub batch size of 500 as suggested by @krasio as we have a lot of records to fix.

select count(*) from ci_job_artifacts where partition_id = 101;

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

UPDATE ci_job_artifacts
SET partition_id = 100
WHERE ci_job_artifacts.id BETWEEN 100000 AND 100500
AND ci_job_artifacts.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