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 1 commit
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
1 change: 1 addition & 0 deletions replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ func (r *Raft) sendLatestSnapshot(s *followerReplication) (bool, error) {
peer := s.peer
s.peerLock.RUnlock()

r.logger.Info("installing snapshot on", "peer", peer, "id", snapID, "size", req.Size)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r.logger.Info("installing snapshot on", "peer", peer, "id", snapID, "size", req.Size)
r.logger.Info("installing snapshot on", "peer", peer.ID, "id", snapID, "size", req.Size)

Also do you mind adding peer.ID and snapID to the other two log lines in this func? It's nice when related log lines have the appropriate context to tie them all together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good shout, Michael, thanks! Fixed in 9c2797b

// Make the call
start := time.Now()
var resp InstallSnapshotResponse
Expand Down
Loading