From 498a3b3401c258f1bf2d5de18d77252171348b4a Mon Sep 17 00:00:00 2001 From: Bartek Nowotarski Date: Tue, 1 Mar 2022 01:20:19 +0100 Subject: [PATCH 1/3] services/horizon: Add LedgerHashStore to Captive-Core config (#4251) This commit revers LedgerHashStore removed from Horizon's CaptiveCoreConfig in: b7fde58. This change makes it impossible to PrepareRange using Captive-Core if there is any other ingestion instance running because CaptiveCoreBackend tries to load the hash of the ledger from archives when LedgerHashStore is not set. But ledgers are published every 5 minutes so they contain the hash of the latest ledger only for a brief amount of time (the moment when checkpoint is published). --- services/horizon/internal/ingest/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/horizon/internal/ingest/main.go b/services/horizon/internal/ingest/main.go index b4b74fc3e6..365937940d 100644 --- a/services/horizon/internal/ingest/main.go +++ b/services/horizon/internal/ingest/main.go @@ -232,6 +232,7 @@ func NewSystem(config Config) (System, error) { NetworkPassphrase: config.NetworkPassphrase, HistoryArchiveURLs: []string{config.HistoryArchiveURL}, CheckpointFrequency: config.CheckpointFrequency, + LedgerHashStore: ledgerbackend.NewHorizonDBLedgerHashStore(config.HistorySession), Log: logger, Context: ctx, }, From 67888321f82db7dd83599c61b05d4f999ddd9678 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Fri, 4 Mar 2022 13:54:28 +0000 Subject: [PATCH 2/3] Add note to the changelog about write iops --- services/horizon/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/services/horizon/CHANGELOG.md b/services/horizon/CHANGELOG.md index bd13a92d50..49c5caea2c 100644 --- a/services/horizon/CHANGELOG.md +++ b/services/horizon/CHANGELOG.md @@ -14,6 +14,7 @@ file. This project adheres to [Semantic Versioning](http://semver.org/). ### Features * New feature, enable captive core based ingestion to use remote db persistence rather than in-memory for ledger states. Essentially moves what would have been stored in RAM to the external db instead. Recent profiling on the two approaches shows an approximate space usage of about 8GB for ledger states as of 02/2022 timeframe, but it will gradually continue to increase as more accounts/assets are added to network. Current horizon ingest behavior when configured for captive core usage will by default take this space from RAM, unless a new command line flag is specified `--captive-core-use-db=true`, which enables this space to be taken from the external db instead, and not RAM. The external db used is determined be setting `DATABASE` parameter in the captive core cfg/.toml file. If no value is set, then by default it uses sqlite and the db file is stored in `--captive-core-storage-path` - ([4092](https://github.com/stellar/go/pull/4092)) + * Note, if using this feature, we recommend using a storage device with capacity for at least 3000 write ops/second. ### Fixes From e29c7803d487c3f5b44a74773e6277fee16482cf Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Fri, 4 Mar 2022 14:35:43 +0000 Subject: [PATCH 3/3] Adding changelog entry for 4251 --- services/horizon/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/horizon/CHANGELOG.md b/services/horizon/CHANGELOG.md index 49c5caea2c..eb57cf5c3e 100644 --- a/services/horizon/CHANGELOG.md +++ b/services/horizon/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## v2.15.1 + +**Upgrading to this version from <= v2.8.3 will trigger a state rebuild. During this process (which will take at least 10 minutes), Horizon will not ingest new ledgers.** + +### Fixes + +* Fixed a regression preventing running multiple concurrent captive-core ingestion instances. ([4251](https://github.com/stellar/go/pull/4251)) + ## v2.15.0 **Upgrading to this version from <= v2.8.3 will trigger a state rebuild. During this process (which will take at least 10 minutes), Horizon will not ingest new ledgers.**