Skip to content

Fix partition_id for ci_build_needs

Max Orefice requested to merge morefice/fix-partition-id-ci-build-need into master

Ref: #387301 (closed)

What does this MR do and why?

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

Merge only after

Database

We have around ~37K records to fix so we don't need a batched migration here as discussed on slack.

We need to wait for ci_builds migration to be executed in order to test this out properly with database-testing-automation.

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

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

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