Skip to content

Add aggregated VSA consistency check service

Adam Hegyi requested to merge 344804-vsa-consistency-service into master

What does this MR do and why?

Note: not user-facing change.

This MR implements a consistency check for Value Stream Analytics. Within the aggregated VSA feature we collect issue and MR data in separate DB tables. The tables are separated from the core domain models (Issue and MergeRequest), there are no foreign keys.

This service will be used to periodically check consistency for the aggregated data and clean up the inconsistent rows.

You can read more about the aggregated backend here: https://gitlab.com/gitlab-org/gitlab/-/blob/58535e5277778c052bf463c18d57b19064b5bf48/doc/development/value_stream_analytics/value_stream_analytics_aggregated_backend.md

Database query

Batching

The batching query uses in-operator optimization.

Uncached plan: https://explain.depesz.com/s/A09

Existence check

Existence check query (uncached): https://explain.depesz.com/s/DEzh

Delete query

This happens very rarely: https://explain.depesz.com/s/iAkx

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #344804 (closed)

Edited by Adam Hegyi

Merge request reports