Skip to content
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

Reingestion is broken for the history_{transaction,operation}_claimable_balances tables #3659

Closed
2opremio opened this issue Jun 3, 2021 · 2 comments
Labels
Milestone

Comments

@2opremio
Copy link
Contributor

2opremio commented Jun 3, 2021

When running the following command in testnet, @jacekn found a problem

# stellar-horizon-cmd db reingest range 380400 381000
2021/06/03 09:28:50 error processing ledger sequence=380504: Error commiting changes from processor: error in *processors.ClaimableBalancesTransactionProcessor.Commit: could not flush transaction claimable balances to db: error adding values while inserting to history_transaction_claimable_balances: exec failed: pq: duplicate key value violates unique constraint "index_history_transaction_claimable_balances_on_ids"

It turns out that the history_{transaction,operation}_claimable_balances tables, introduced in Horizon 2.1, are not cleaned up (see the DeleteRangeAll() code) before reingesting a range. This causes conflicts with existing rows due to UNIQUE constraints.

@2opremio 2opremio added the bug label Jun 3, 2021
@2opremio 2opremio added this to the Horizon 2.5.0 milestone Jun 3, 2021
@2opremio
Copy link
Contributor Author

2opremio commented Jun 3, 2021

We should consider releasing Horizon 2.4.1 with a fix for this

@ire-and-curses
Copy link
Member

Yes we should do a patch release ASAP

paulbellamy pushed a commit to paulbellamy/stellar-go that referenced this issue Jun 7, 2021
paulbellamy pushed a commit that referenced this issue Jun 7, 2021
…tion}_claimable_balances` tables (#3661)

* Update the db setup (migrations, tables, indexes, etc) for kahuna to match base

* refactor DeleteRangeAll to simplify it

* Also clear the history_*_claimable_balances tables in DeleteRangeAll for reingestion

Fixes #3659

* Update changelog

* Try with a map to clean up the loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants