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

services/horizon: Fix reingestion for the history_{transaction,operation}_claimable_balances tables #3661

Merged
merged 5 commits into from
Jun 7, 2021

Conversation

paulbellamy
Copy link
Contributor

@paulbellamy paulbellamy commented Jun 4, 2021

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

Also delete the ranges from history_{transaction,operation}_claimable_balances tables.

Why

So that they don't get duplicate insertion conflicts when reingesting with existing claimable balance data.

Known limitations

I didn't add any tests for this yet. How to test reingestion generally needs a bit more thought (IMO) than I wanted to have scope in this PR.

services/horizon/internal/db2/history/main.go Outdated Show resolved Hide resolved
@paulbellamy paulbellamy force-pushed the 3659/fix_reingestion branch 3 times, most recently from 2f2ff35 to da5b03f Compare June 4, 2021 16:45
@paulbellamy
Copy link
Contributor Author

paulbellamy commented Jun 4, 2021

Ok, so had to update kahuna to get the tests passing again. Basically, just did a diff between the base-horizon.sql, and kahuna-horizon.sql and copied over the table/index setups/teardowns. @bartekn does that seem like the right approach here? Not really sure on the normal maintenance for those files...

@2opremio
Copy link
Contributor

2opremio commented Jun 7, 2021

@paulbellamy I think that approach is fine. The scenarios are deprecated.

@paulbellamy paulbellamy merged commit 1a050fd into stellar:master Jun 7, 2021
@paulbellamy paulbellamy deleted the 3659/fix_reingestion branch June 7, 2021 12:23
paulbellamy pushed a commit that referenced this pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants