The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3903
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) ===
From cc90c9f9bac27c204b63aa6057faa2d8d091fc61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]> Date: Thu, 5 Oct 2017 12:59:14 -0400 Subject: [PATCH 1/2] Fix bad DB schema update between schema 30 and 31 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <[email protected]> --- lxd/db/schema/schema.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lxd/db/schema/schema.go b/lxd/db/schema/schema.go index d80f37db7..795bc6af9 100644 --- a/lxd/db/schema/schema.go +++ b/lxd/db/schema/schema.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/lxc/lxd/lxd/db/query" + "github.com/lxc/lxd/shared" ) // Schema captures the schema of a database in terms of a series of ordered @@ -164,6 +165,19 @@ func ensureUpdatesAreApplied(tx *sql.Tx, updates []Update, hook Hook) error { return fmt.Errorf("failed to fetch update versions: %v", err) } + // Fix bad upgrade code between 30 and 32 + if shared.IntInSlice(30, versions) && shared.IntInSlice(32, versions) && !shared.IntInSlice(31, versions) { + err = insertSchemaVersion(tx, 31) + if err != nil { + return fmt.Errorf("failed to insert missing schema version 31") + } + + versions, err = selectSchemaVersions(tx) + if err != nil { + return fmt.Errorf("failed to fetch update versions: %v", err) + } + } + current := 0 if len(versions) > 0 { err = checkSchemaVersionsHaveNoHoles(versions) From d4bfd1ad16d6a8d2cad2bfcf446da6a1ac72e6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]> Date: Tue, 3 Oct 2017 17:36:03 -0400 Subject: [PATCH 2/2] images: Fix bad error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <[email protected]> --- lxd/images.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/images.go b/lxd/images.go index 973ed8500..eb3a3dabf 100644 --- a/lxd/images.go +++ b/lxd/images.go @@ -945,7 +945,7 @@ func autoUpdateImage(d *Daemon, op *operation, id int, info *api.Image) error { if info.Cached { err = db.ImageLastAccessInit(d.db, hash) if err != nil { - logger.Error("Error moving aliases", log.Ctx{"err": err, "fp": hash}) + logger.Error("Error setting cached flag", log.Ctx{"err": err, "fp": hash}) continue } }
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
