From cf579c96e61743440a23c0c8900a2449ff11b870 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 2 Feb 2022 17:21:38 +0100 Subject: [PATCH 1/3] Add CHANGELOG entry for Horizon 2.14.0 release (#4208) --- services/horizon/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/horizon/CHANGELOG.md b/services/horizon/CHANGELOG.md index ad4fda1128..c0d20f1f4f 100644 --- a/services/horizon/CHANGELOG.md +++ b/services/horizon/CHANGELOG.md @@ -5,6 +5,13 @@ file. This project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +## v2.14.0 + +* Restart Stellar-Core when it's context is cancelled. ([4192](https://github.com/stellar/go/pull/4192)) +* Resume ingestion immediately when catching up. ([4196](https://github.com/stellar/go/pull/4196)) +* Check if there are newer ledger when requested ledger does not exist. ([4198](https://github.com/stellar/go/pull/4198)) +* Properly check against the HA array being empty. ([4152](https://github.com/stellar/go/pull/4152)) + ## v2.13.0 ### DB Schema Migration From a1b3c88e254505d6f6fa08be4eea9b44ca85e000 Mon Sep 17 00:00:00 2001 From: Bartek Nowotarski Date: Sun, 13 Feb 2022 15:01:58 +0100 Subject: [PATCH 2/3] services/horizon: Release DB connection in /paths when no longer needed --- services/horizon/internal/actions/path.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/horizon/internal/actions/path.go b/services/horizon/internal/actions/path.go index 6c2e97fcd2..49e4e9df07 100644 --- a/services/horizon/internal/actions/path.go +++ b/services/horizon/internal/actions/path.go @@ -301,6 +301,18 @@ func (handler FindFixedPathsHandler) GetResource(w HeaderWriter, r *http.Request } } + // Rollback REPEATABLE READ transaction so that a DB connection is released + // to be used by other http requests. + historyQ, err := horizonContext.HistoryQFromRequest(r) + if err != nil { + return nil, errors.Wrap(err, "could not obtain historyQ from request") + } + + err = historyQ.Rollback() + if err != nil { + return nil, errors.Wrap(err, "error in rollback") + } + sourceAsset := qp.SourceAsset() amountToSpend := qp.Amount() From 41b9b6d4453f3c304de2c83407a3b6b7c5ff881b Mon Sep 17 00:00:00 2001 From: Bartek Nowotarski Date: Sun, 13 Feb 2022 15:28:31 +0100 Subject: [PATCH 3/3] Add to FindPathsHandler --- services/horizon/internal/actions/path.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/horizon/internal/actions/path.go b/services/horizon/internal/actions/path.go index 49e4e9df07..3a16e22834 100644 --- a/services/horizon/internal/actions/path.go +++ b/services/horizon/internal/actions/path.go @@ -148,6 +148,18 @@ func (handler FindPathsHandler) GetResource(w HeaderWriter, r *http.Request) (in } } + // Rollback REPEATABLE READ transaction so that a DB connection is released + // to be used by other http requests. + historyQ, err := horizonContext.HistoryQFromRequest(r) + if err != nil { + return nil, errors.Wrap(err, "could not obtain historyQ from request") + } + + err = historyQ.Rollback() + if err != nil { + return nil, errors.Wrap(err, "error in rollback") + } + records := []paths.Path{} if len(query.SourceAssets) > 0 { var lastIngestedLedger uint32