mirror of https://github.com/tidwall/tile38.git
Fix follower not authenticating after an aofshrink
This commit is contained in:
parent
4a0bab3e3a
commit
0b2814d8e0
|
@ -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")
|
||||
}
|
||||
|
@ -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)
|
||||
|
|
|
@ -224,7 +224,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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue