From 68db7df08de06823905c16fafff7e91733976916 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 13 Dec 2017 14:10:54 -0800 Subject: [PATCH] Removes timeout when restoring snapshots. Fixes #3326 Originally I started out making this configurable, but realized it wasn't worth the complexity. If you are restoring a snapshot, you really need to wait until it's done, or something bad happens like losing leadership, which will already trigger an error. Rather than have operators have to tune this to cover whatever their snapshot size is, we just make it block here. There's also already a bocking barrier right after the restore that hasn't been a problem. --- snapshot/snapshot.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snapshot/snapshot.go b/snapshot/snapshot.go index e39cb12a16..cd62475c72 100644 --- a/snapshot/snapshot.go +++ b/snapshot/snapshot.go @@ -10,7 +10,6 @@ import ( "io/ioutil" "log" "os" - "time" "github.com/hashicorp/raft" ) @@ -185,7 +184,7 @@ func Restore(logger *log.Logger, in io.Reader, r *raft.Raft) error { } // Feed the snapshot into Raft. - if err := r.Restore(&metadata, snap, 60*time.Second); err != nil { + if err := r.Restore(&metadata, snap, 0); err != nil { return fmt.Errorf("Raft error when restoring snapshot: %v", err) }