-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: historical allocations not appearing #9522
Conversation
✅ Deploy Preview for determined-ui canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9522 +/- ##
==========================================
- Coverage 49.28% 49.28% -0.01%
==========================================
Files 1242 1242
Lines 161442 161442
Branches 2867 2867
==========================================
- Hits 79574 79570 -4
- Misses 81696 81700 +4
Partials 172 172
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I guess?
Is the fix not apparent in master/internal/db/postgres_cluster.go? Not dropping columns with conflicts seems more like a hack than a fix, but I don't think I understand the problem fully.
Also, mark this as a "chore" not a "fix" for release party, or explicitly state in the description that no testing is needed.
Yeah we can't drop the columns or update them on conflict because the we don't want data that is already present to be modified. The specific problem is related to timezones and how they might (or might not) be saved and how they can change. We are investigating more and definitely want to fix the behavior inside of TLDR this doesn't fix the underlying cause, but it addresses the symptoms + I would expect the historical allocation code to handle key conflicts in this way anyways. |
Ticket
DET-10311
Description
Historical allocations weren't showing up sometimes because the data was not present. This can occur when we attempt to calculate the historical allocation for the same date again, violating a constraint and failing the whole transaction. This leads to us repeatedly failing to calculate historical allocation and the data remaining empty. To fix this, we add a clause so that nothing happens when a conflict happens.
Test Plan
No manual testing required.
Testing this is difficult to reproduce, but if you would like to verify, one way is (on your own devcluster) go to
master/internal/db/postgres_cluster.go
line 99 and addlastDatePtr=nil
. This forces there to be a key conflict. If devcluster runs successfully, then the PR works.Checklist
docs/release-notes/
.See Release Note for details.