-
Notifications
You must be signed in to change notification settings - Fork 170
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
Conversation
kderme
left a comment
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 |
a695146 to
d5eafa0
Compare
d5eafa0 to
22f9f48
Compare
3094874 to
8e6340f
Compare
|
after the fix from #2010 the rollback are now fixed here too. The migration file is still in place to remove any corrupted data & add new constraints to stop this happening in the future. New tests we're added to mitigate this happening in the future. |
f7e8129 to
39b12be
Compare
39b12be to
7b11576
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.