Skip to content

Add wraparound vacuum checks for PDM

Marius Bobin requested to merge 19406-mb-check-for-vacuum into master

What does this MR do and why?

Implements gitlab-com/gl-infra/delivery#19406 (comment 1690890146)

It can skip the post deployment migration pipeline if there is any wraparound vacuum detected on any of the tables from the migration file names. For this to work properly we need to the full table names on migrations that require locks that are not compatible with the vacuum one. For example a migration that adds a foreign key between ci_builds and ci_job_artifacts must be called add_fk_between_ci_builds_and_ci_job_artifacts. Migration that don't need expensive lock must not use the complete table name or else the PDM will be unnecessarily skipped, for example to add an async index on the ci_job_artifacts table we don't need the lock so we should use add_index_on_job_artifacts as migration name.

It is behind a feature flag, vacuum_check.

https://thanos-query.ops.gitlab.net/graph?g0.expr=pg_stat_activity_autovacuum_age_in_seconds{relname%3D~%22.*wraparound\)%22%2C%20type%3D%22patroni-ci%22}&g0.tab=0&g0 can be used to see what wraparound vacuums are running, as a follow-up it could be included in the wraparound_vacuum_on_post_migrations_message message.

Content

  • Add wraparound vacuum checks for PDM

Author Check-list

  • Has documentation been updated?
Edited by Marius Bobin

Merge request reports

Loading