From db88d9764c909c527e8452a84acc33a81e136e92 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Mon, 9 Feb 2015 14:37:06 -0800 Subject: [PATCH] migrate: fix setting commit index from snapshot --- migrate/etcd4.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrate/etcd4.go b/migrate/etcd4.go index 98b3f112e..2681a5bd1 100644 --- a/migrate/etcd4.go +++ b/migrate/etcd4.go @@ -103,7 +103,7 @@ func Migrate4To2(dataDir string, name string) error { st2 := cfg4.HardState2() // If we've got the most recent snapshot, we can use it's committed index. Still likely less than the current actual index, but worth it for the replay. - if snap2 != nil { + if snap2 != nil && st2.Commit < snap2.Metadata.Index { st2.Commit = snap2.Metadata.Index }