Skip to content

Unstuck VSA background aggregations

Adam Hegyi requested to merge ah-unstuck-vsa-bg-aggregations into master

What does this MR do and why?

This MR fixes the currently stuck VSA background aggregations due to the incorrect records in the analytics_cycle_analytics_aggregations.

Problem:

Value stream analytics page:

image

A mistake in the license check allowed the backend to insert user namespace ids into the analytics_cycle_analytics_aggregations where we only expect Group ids.

This caused the background processing job to stuck:

Analytics::CycleAnalytics::IncrementalWorker.new.perform
ActiveRecord::RecordInvalid: Validation failed: Namespace the assigned object is not supported

As of today, we only support Group records. I opened #398607 (closed) to discuss whether we want to support user namespaces as well (this would be a bigger task so I'm looking for a quick fix here).

Fix

I verified the fix on DB lab using production replica DB.

  1. Update the license check and require a Group top-level namespace.
  2. Post migration for deleting the wrongfully added user namespace records (no user facing effect).

The post migration iterates over 9K rows and deletes about 150 rows on production.

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.

Edited by Adam Hegyi

Merge request reports