-
Couldn't load subscription status.
- Fork 168
1986 - Fix duplicate pool stats #1987
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
base: master
Are you sure you want to change the base?
Conversation
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.
This adds a unique key, but doesn't change the function that inserts the values. So if dbsync tries again to insert a duplicate, it will crash, instead of doing a no-op.
Also, instances that upgrade to this version and already have duplicates, would fail to create the unique key altoether.
Finally, any idea what could be the root cause of creating a duplicate in the first place?
|
ok think I've found it:
cardano-db-sync/cardano-db/src/Cardano/Db/Operations/Delete.hs Lines 122 to 138 in e00405d
Will write tests see if that's the case |
0d7c288 to
1dfa4ac
Compare
|
@kderme should we do a check to see if there are duplicates when starting DB sync and if so delete them? This should cover those who have old corrupted data |
0998ecd to
a695146
Compare
a695146 to
d5eafa0
Compare
Description
This fixes #1986
Due to complexity of partial entries and rollbacks it was just as performant to add a unique constraints to the table
Checklist
fourmoluon version 0.10.1.0 (which can be run withscripts/fourmolize.sh)Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.