From 9047a0ef78ad01000c16c6388782d8829d39900e Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 12 Jul 2021 15:38:57 +0100 Subject: [PATCH 1/3] Fix an off-by-one bug in down and redo migrations --- services/horizon/cmd/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/horizon/cmd/db.go b/services/horizon/cmd/db.go index 0412bb3c3e..31f0f27879 100644 --- a/services/horizon/cmd/db.go +++ b/services/horizon/cmd/db.go @@ -99,7 +99,7 @@ var dbMigrateDownCmd = &cobra.Command{ os.Exit(1) } - count, err := strconv.Atoi(args[1]) + count, err := strconv.Atoi(args[0]) if err != nil { log.Println(err) cmd.Usage() @@ -123,7 +123,7 @@ var dbMigrateRedoCmd = &cobra.Command{ os.Exit(1) } - count, err := strconv.Atoi(args[1]) + count, err := strconv.Atoi(args[0]) if err != nil { log.Println(err) cmd.Usage() From 8cc09c7a897930d27135cb158d48e1076cee94cd Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 12 Jul 2021 15:50:27 +0100 Subject: [PATCH 2/3] We need to actually use the direction for migrations instead of just 'redo' --- services/horizon/cmd/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/horizon/cmd/db.go b/services/horizon/cmd/db.go index 31f0f27879..e86ab7c329 100644 --- a/services/horizon/cmd/db.go +++ b/services/horizon/cmd/db.go @@ -74,7 +74,7 @@ func migrate(dir schema.MigrateDir, count int) { log.Fatal(err) } - numMigrationsRun, err := schema.Migrate(dbConn.DB.DB, schema.MigrateRedo, count) + numMigrationsRun, err := schema.Migrate(dbConn.DB.DB, dir, count) if err != nil { log.Fatal(err) } From cdfb2ea66ed054dc13511494b50de3d78508e424 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 12 Jul 2021 15:57:28 +0100 Subject: [PATCH 3/3] update changelog --- services/horizon/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/horizon/CHANGELOG.md b/services/horizon/CHANGELOG.md index 514ac3278d..d8812ecf95 100644 --- a/services/horizon/CHANGELOG.md +++ b/services/horizon/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## v2.6.1 + +**Upgrading to this version from <= v2.5.2 will trigger a state rebuild. During this process (which will take at least 10 minutes), Horizon will not ingest new ledgers.** + +* Fix bug introduced in v2.6.0 ([#3737](https://github.com/stellar/go/pull/3737)), preventing usage of `horizon db migrate up/down/redo` commands. ([#3762](https://github.com/stellar/go/pull/3762)) ## v2.6.0