Skip to content

insights: More robust find-and-replace for series_ids in oob settings migration

Administrator requested to merge insights/migration/fix-backfill into main

Created by: CristinaBirkel

This does two things:

  1. If the find-and-replace in updateTimeSeriesReferences makes 0 updates, we do NOT stamp the backfill_queued_at so that it has a chance to calculate the points. I don't expect this case to happen, but we saw something like this happen on k8s so this is a guard against it.
  2. Now it also does a find-and-replace on the insights_query_runner_jobs.series_id field as well. This is to handle a case where series points are being calculated when the migration is running; if we didn't do this, the series points would continue to be calculated with the old series_id and never included on the chart.

The if statements got a bit nested, but I think it makes enough sense for temporary code. Also let me know if you see any issues with the workerStore being included like that. It's not all part of the same transaction, but it's in a different database so I don't think there's much we can do about that.

Merge request reports

Loading