Skip to content

Commit

Permalink
auth: print warning log when error is ErrAuthOldRevision
Browse files Browse the repository at this point in the history
  • Loading branch information
tangcong committed Mar 3, 2020
1 parent cb63341 commit ebe256d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions auth/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,13 @@ func (as *authStore) isOpPermitted(userName string, revision uint64, key, rangeE
if revision == 0 {
return ErrUserEmpty
}

if revision < as.Revision() {
rev := as.Revision()
if revision < rev {
as.lg.Warn("request auth revision is less than current node auth revision",
zap.Uint64("current node auth revision", rev),
zap.Uint64("request auth revision", revision),
zap.ByteString("request key", key),
zap.Error(ErrAuthOldRevision))
return ErrAuthOldRevision
}

Expand Down

0 comments on commit ebe256d

Please sign in to comment.