-
Notifications
You must be signed in to change notification settings - Fork 501
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
ingest: Reuse Stellar-Core's cached buckets if possible. #3670
Conversation
What's the reason Horizon is not backwards-compatible? |
@ire-and-curses I think I misspoke. More accurately: to take advantage of the performance improvement, we need >= 17.1. Otherwise, I think Core will just flush the buckets folder. I'm building an older binary as we speak to make sure it's still backwards compatible. The biggest change in both cases, though, is that the directory isn't cleaned up on shutdown anymore. |
Ok, that's what I was expecting, thanks. Yeah as you say let's confirm for sure it will still work with an older version (and just won't be any faster). |
2d472a9
to
90f29a7
Compare
Have you checked this? I think Stellar-Core does not flush the folder between runs. I checked the failing test: |
I tested with 17.0 and confirmed that it does delete and redownload the bucket files @bartekn.
Yep, I came to the same exact conclusion and introduced |
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.
I tested with 17.0 and confirmed that it does delete and redownload the bucket files @bartekn.
Sounds good! On the contrary 17.1 does not delete the buckets, correct?
LGTM!
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. This projec | |||
|
|||
## Unreleased | |||
|
|||
### New Features | |||
* **Performance improvement**: the Captive Core backend now reuses bucket files whenever it finds existing ones in the corresponding `--captive-core-storage-path` (introduced in [v2.0](#v2.0.0)) rather than generating a one-time temporary sub-directory ([#3670](https://github.com/stellar/go/pull/3670)). Note that taking advantage of this feature requires [Stellar-Core v17.1.0](https://github.com/stellar/stellar-core/releases/tag/v17.1.0) or later. |
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.
Shouldn't we use value from Config
instead of --captive-core-storage-path
?
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.
Ironically, --captive-core-storage-path
means something more to Horizon than Captive Core. The corresponding BUCKET_DIR_PATH
within Stellar-Core's config is a relative path to the directory from which the stellar-core
command is run, so it's essentially path.Join(config.CaptiveCoreStoragePath, config.Toml.BucketDirPath)
(psuedocode). Horizon uses this arg to create the directory, and that means the TOML file doesn't really apply.
We could merge these two options, but that's out of scope and requires more discussion since we'd finally be diverging from a Core-compatible TOML file.
@bartekn correct! The catchup is much faster as expected. |
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
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
Stellar-Core can intelligently reuse existing bucket files (stellar/stellar-core#2994) as of v17.1.0 (see the release notes). We store these under the
--captive-core-storage-path=./
directory. It used to be a randomly-generated subfolder (e.g.captive-core-d34db33f/
) on startup; now it's kept consistent (justcaptive-core/
) to take advantage of this feature.Why
Performance: faster startup. Closes #3631.
Known limitations
This feature is only available with Stellar-Core >= v17.1.0. We can introduce version checks to keep having random buckets with < 17.1, but this will complicate startup significantly, since we'd now need to run & parse
stellar-core version
.Needs #3683 to be merged first for proper 17.1 support in our builds.