This repository was archived by the owner on Sep 30, 2024. It is now read-only.
insights: add oob migration for recording times back with fix#44499
Merged
Conversation
added 2 commits
November 16, 2022 13:46
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 2bdefd3...8826a79.
|
leonore
commented
Nov 16, 2022
| return nil | ||
| } | ||
|
|
||
| func selectSeriesMetadata(ctx context.Context, tx *basestore.Store, batchSize int) (map[int]seriesMetadata, error) { |
Contributor
Author
There was a problem hiding this comment.
this is the main change: I've pulled out the logic here into helper functions. but the only change is really
for rows.Next()is now correct for both functions
leonore
commented
Nov 16, 2022
| if len(existingPoints) == 0 { | ||
| return referenceTimes | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
I removed the logic to early exit on len(existingPoints) = len(recordingTimes).
coury-clark
approved these changes
Nov 16, 2022
coury-clark
added a commit
that referenced
this pull request
Nov 16, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #43496 (again)
the (second) bug was that on second iteration through sql rows I iterated through
rows.Next()rather thanrecordingRows.Next(), which meant we would always reuse generated recording times rather than any existing timestamps.Test plan
Manually stepped through all the logic. Wrote a unit test. Manually ran the migration again on a local instance.