Skip to content

Commit

Permalink
Removes timeout when restoring snapshots.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slackpad committed Dec 13, 2017
1 parent 57a9ff0 commit 68db7df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"io/ioutil"
"log"
"os"
"time"

"github.com/hashicorp/raft"
)
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 68db7df

Please sign in to comment.