Skip to content

Commit

Permalink
Fix follower not authenticating after aofshink
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed Sep 22, 2022
1 parent 757db4d commit fe180dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion internal/server/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ func getEndOfLastValuePositionInFile(fname string, startPos int64) (int64, error

// followCheckSome is not a full checksum. It just "checks some" data.
// We will do some various checksums on the leader until we find the correct position to start at.
func (s *Server) followCheckSome(addr string, followc int) (pos int64, err error) {
func (s *Server) followCheckSome(addr string, followc int, auth string,
) (pos int64, err error) {
if core.ShowDebugMessages {
log.Debug("follow:", addr, ":check some")
}
Expand All @@ -157,6 +158,12 @@ func (s *Server) followCheckSome(addr string, followc int) (pos int64, err error
}
defer conn.Close()

if auth != "" {
if err := s.followDoLeaderAuth(conn, auth); err != nil {
return 0, err
}
}

min := int64(0)
max := int64(s.aofsz) - checksumsz
limit := int64(s.aofsz)
Expand Down
2 changes: 1 addition & 1 deletion internal/server/follow.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (s *Server) followStep(host string, port int, followc int) error {
}

// verify checksum
pos, err := s.followCheckSome(addr, followc)
pos, err := s.followCheckSome(addr, followc, auth)
if err != nil {
return err
}
Expand Down

0 comments on commit fe180dc

Please sign in to comment.