Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raft worker errors #13325

Merged
merged 1 commit into from
Sep 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions worker/raft/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ func (w *Worker) loop(raftConfig *raft.Config) (loopErr error) {

rawLogStore, err := NewLogStore(w.config.StorageDir, syncMode)
if err != nil {
// Required logging, as ErrStartTimeout can mask the underlying error
// and we never know the original failure.
w.config.Logger.Errorf("Failed to setup raw log store, err: %v", err)
return errors.Trace(err)
}

Expand All @@ -326,11 +329,17 @@ func (w *Worker) loop(raftConfig *raft.Config) (loopErr error) {
}
snapshotStore, err := NewSnapshotStore(w.config.StorageDir, snapshotRetention, w.config.Logger)
if err != nil {
// Required logging, as ErrStartTimeout can mask the underlying error
// and we never know the original failure.
w.config.Logger.Errorf("Failed to setup snapshot store, err: %v", err)
return errors.Trace(err)
}

r, err := raft.NewRaft(raftConfig, w.config.FSM, logStore, rawLogStore, snapshotStore, w.config.Transport)
if err != nil {
// Required logging, as ErrStartTimeout can mask the underlying error
// and we never know the original failure.
w.config.Logger.Errorf("Failed to setup raft instance, err: %v", err)
return errors.Trace(err)
}
defer func() {
Expand Down