Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

insights: oob migration for saving recording times for existing insights#44165

Merged
leonore merged 22 commits into
mainfrom
insights/save-recordings-past-insights
Nov 14, 2022
Merged

insights: oob migration for saving recording times for existing insights#44165
leonore merged 22 commits into
mainfrom
insights/save-recordings-past-insights

Conversation

@leonore

@leonore leonore commented Nov 9, 2022

Copy link
Copy Markdown
Contributor

closes #43496

heuristic for using existing recording_times rather than generated ones is + half an interval (quarter of for hourly insights)

image

Test plan

Added unit tests for migrator and helpers
Tested manually on existing insights by setting supports_augmentation = FALSE and deleting all existing recording times, running the oob migration and validating that insights still look good

@leonore leonore requested a review from a team November 9, 2022 17:29
@cla-bot cla-bot Bot added the cla-signed label Nov 9, 2022
@sourcegraph-bot

sourcegraph-bot commented Nov 9, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff ef37174...b3878a8.

Notify File(s)
@efritz internal/oobmigration/oobmigrations.yaml

@chwarwick

Copy link
Copy Markdown
Contributor

I think this looks good, but I think we also need an noop migrator that reports 100% if insights is disabled.

@coury-clark coury-clark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change to prevent any deadlock issues, otherwise looks good!

Comment thread enterprise/internal/oobmigration/migrations/insights/recording_times_migrator.go Outdated
series[id] = seriesMetadata{
id: id,
createdAt: createdAt,
lastRecordedAt: lastRecordedAt,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just talking out loud:

If a record is currently queued when this runs, we should be fine because the new recording time will be written whenever that job executes.

Comment thread enterprise/internal/oobmigration/migrations/insights/recording_times_migrator.go Outdated
@leonore leonore requested a review from chwarwick November 14, 2022 15:52
@leonore leonore merged commit 3f814d1 into main Nov 14, 2022
@leonore leonore deleted the insights/save-recordings-past-insights branch November 14, 2022 16:47
leonore pushed a commit that referenced this pull request Nov 15, 2022
coury-clark added a commit that referenced this pull request Nov 15, 2022
coury-clark added a commit that referenced this pull request Nov 16, 2022
* Revert "insights: fix zero values oob migration recording time fetching (#44409)"

This reverts commit 77a7758.

* Revert "insights: oob migration for saving recording times for existing insights (#44165)"

This reverts commit 3f814d1.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

insights: write migration to save recording times for existing insights

4 participants