diff --git a/services/horizon/CHANGELOG.md b/services/horizon/CHANGELOG.md index 2d3ebe7cb5..9724e52dc0 100644 --- a/services/horizon/CHANGELOG.md +++ b/services/horizon/CHANGELOG.md @@ -8,6 +8,7 @@ file. This project adheres to [Semantic Versioning](http://semver.org/). ### Code Changes * Fix bug in `horizon db reingest range` command, which would throw a duplicate entry conflict error from the DB. ([3661](https://github.com/stellar/go/pull/3661)). +* Fix bug in DB metrics preventing Horizon from starting when read-only replica middleware is enabled. ([3668](https://github.com/stellar/go/pull/3668)). ## v2.4.0 diff --git a/services/horizon/internal/init.go b/services/horizon/internal/init.go index c9c636faf3..97ab048f99 100644 --- a/services/horizon/internal/init.go +++ b/services/horizon/internal/init.go @@ -62,7 +62,7 @@ func mustInitHorizonDB(app *App) { )} app.primaryHistoryQ = &history.Q{mustNewDBSession( - db.HistorySubservice, + db.HistoryPrimarySubservice, app.config.DatabaseURL, maxIdle, maxOpen, diff --git a/support/db/metrics.go b/support/db/metrics.go index 1733d2d1d7..5b322e80c8 100644 --- a/support/db/metrics.go +++ b/support/db/metrics.go @@ -19,6 +19,7 @@ var QueryTypeContextKey = CtxKey("query_type") type Subservice string var CoreSubservice = Subservice("core") +var HistoryPrimarySubservice = Subservice("history_primary") var HistorySubservice = Subservice("history") var IngestSubservice = Subservice("ingest")