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

Unique constraint violates "exp_history_ledgers_id_idx" when reingesting state #2052

Closed
bartekn opened this issue Dec 12, 2019 · 1 comment
Closed
Assignees
Labels

Comments

@bartekn
Copy link
Contributor

bartekn commented Dec 12, 2019

What version are you using?

Horizon 0.24.1 RC.

What did you do?

Horizon 0.24.1 RC (fb5f489) fixes a bug in expingest so expingest.CurrentVersion was incremented. This made Horizon to reingest state.

What did you expect to see?

No errors.

What did you see instead?

Processor DatabaseProcessor (All) errored: Could not insert ledger: exec failed: pq: duplicate key value violates unique constraint \"exp_history_ledgers_id_idx\"

What happened?

Horizon always reingests state using the latest checkpoint ledger and in most cases the sequence of this ledger will be smaller than the latest ingested ledger. Because of this Horizon will attempt to insert old ledgers into exp_history_ledger again. It seems that the quick fix that should be included in 0.24.1 is to remove all ledgers with the sequence higher than the checkpoint ledger. The longterm fix is #1969.

@tamirms
Copy link
Contributor

tamirms commented Dec 13, 2019

fixed in #2055

@tamirms tamirms closed this as completed Dec 13, 2019
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