[lxc-devel] [lxd/master] Storage: Fixes migrate refresh final sync snapshot bug

tomponline on Github lxc-bot at linuxcontainers.org
Fri Jan 31 10:15:52 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 603 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200131/fd82cb55/attachment.bin>
-------------- next part --------------
From eb874f31d73838a0d9bef232c8b50a6b1db90bd7 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Fri, 31 Jan 2020 10:13:45 +0000
Subject: [PATCH] lxd/migrate/container: Fixes migrate refresh final sync
 snapshot bug

When a container is running, and has a new snapshot to sync during refresh mode, after the snapshot has been synced initially, it is also still sent as part of the final sync stage, which is not needed as snapshots are not being modified.

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/migrate_container.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lxd/migrate_container.go b/lxd/migrate_container.go
index a3a7ca58f4..8af9bd8b38 100644
--- a/lxd/migrate_container.go
+++ b/lxd/migrate_container.go
@@ -754,8 +754,10 @@ func (s *migrationSourceWs) Do(state *state.State, migrateOp *operations.Operati
 	// Perform final sync if in multi sync mode.
 	if volSourceArgs.MultiSync {
 		if pool != nil {
-			// Indicate to the storage driver we are doing final sync.
+			// Indicate to the storage driver we are doing final sync and because of this don't send
+			// snapshots as they don't need to have a final sync as not being modified.
 			volSourceArgs.FinalSync = true
+			volSourceArgs.Snapshots = nil
 
 			err = pool.MigrateInstance(s.instance, &shared.WebsocketIO{Conn: s.fsConn}, volSourceArgs, migrateOp)
 			if err != nil {


More information about the lxc-devel mailing list