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

Add a log line on active node when sending snapshot to a follower #636

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ _testmain.go

*.exe
*.test

# Goland IDE
.idea
5 changes: 3 additions & 2 deletions replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,12 @@ func (r *Raft) sendLatestSnapshot(s *followerReplication) (bool, error) {
peer := s.peer
s.peerLock.RUnlock()

r.logger.Info("installing snapshot on", "peer", peer.ID, "id", snapID, "size", req.Size)
// Make the call
start := time.Now()
var resp InstallSnapshotResponse
if err := r.trans.InstallSnapshot(peer.ID, peer.Address, &req, &resp, snapshot); err != nil {
r.logger.Error("failed to install snapshot", "id", snapID, "error", err)
r.logger.Error("failed to install snapshot", "peer", peer.ID, "id", snapID, "error", err)
s.failures++
return false, err
}
Expand Down Expand Up @@ -375,7 +376,7 @@ func (r *Raft) sendLatestSnapshot(s *followerReplication) (bool, error) {
s.notifyAll(true)
} else {
s.failures++
r.logger.Warn("installSnapshot rejected to", "peer", peer)
r.logger.Warn("installSnapshot rejected to", "peer", peer.ID, "id", snapID)
}
return false, nil
}
Expand Down
Loading