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

/exp/services/ledgerexporter: resumable export, check data storage for optimal starting point #5264

Merged
merged 41 commits into from
Apr 30, 2024

Conversation

sreuland
Copy link
Contributor

@sreuland sreuland commented Mar 28, 2024

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

  • Added ResumableManager, app will call this during init to apply a best effort attempt to check data storage layer and increase the effective start value for captive core ingestion to the boundary aligned starting ledger of the nearest absent object key of data store relative to requested start.
  • Enhanced the DataStoreConfig toml model to be more generic key/value params to allow for holding different data store configuration values going forward, the app checks datastore_config.type to know which datastore instance to create, passing the datastore_config.params to it:
    [datastore_config]
    type = "GCS"
    
    [datastore_config.params]
    destination_url = "gcs://your-bucket-name"
    

Why

Efficiency of exporter, avoiding exporting files to data store that may already be present.

Closes: https://stellarorg.atlassian.net/browse/HUBBLE-272

Known limitations

…ased on latest data in data storage layer, avoiding export of data that already exists on storage.
@sreuland
Copy link
Contributor Author

sreuland commented Mar 28, 2024

I need to run some live integration tests, building ledgerexporter and running it against GCS bucket.

@sreuland
Copy link
Contributor Author

I need to run some live integration tests, building ledgerexporter and running it against GCS bucket.

I ran ledgerexporter on testnet against a real gcs bucket doing a sequence of commands that requested ranges overlapping, to confirm the expected resumable starts were calculated, using ledgers_per_file=1:

ledgerexporter --config-file config.toml --start 842267 --end 844267
... started core at 842267, uploaded all 2000

ledgerexporter --config-file config.toml --start 842267 --end 844267
... log output stating full range existed on data store already, no core or upload attempted

ledgerexporter --config-file config.toml --start 842267 --end 844277
... log output stating start was adjusted to 844268, uploaded next 10

 ledgerexporter --config-file config.toml --start 842267 --end 844287
... log output stating start was adjusted to 844278, uploaded next 10

 ledgerexporter --config-file config.toml --start 842267 --end 0
... log output stating start was adjusted to 844288, and continued on unbounded upload from there

@sreuland sreuland requested review from tamirms and urvisavla April 29, 2024 23:51
Copy link
Contributor

@urvisavla urvisavla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@tamirms tamirms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! I left a few minor suggestions, feel free to apply them as you see fit

@sreuland sreuland merged commit 9808f37 into stellar:master Apr 30, 2024
31 checks passed
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.

4 participants