Don't log error message when multiple nodes try processing a notification hint at the same time. (#2166)

This commit is contained in:
Doug Lauder 2022-01-25 16:30:06 -05:00 committed by GitHub
parent b337392d0d
commit 8f958abb9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -129,7 +129,11 @@ func (n *notifier) notify() {
hint, err = n.store.GetNextNotificationHint(true)
if err != nil {
// try again later
if store.IsErrNotFound(err) {
// Expected when multiple nodes in a cluster try to process the same hint at the same time.
// This simply means the other node won. Returning here will simply try fetching another hint.
return
}
n.logger.Error("notify - error fetching next notification", mlog.Err(err))
return
}

View file

@ -195,7 +195,7 @@ func (s *SQLStore) getNextNotificationHint(db sq.BaseRunner, remove bool) (*mode
if rows == 0 {
// another node likely has grabbed this hint for processing concurrently; let that node handle it
// and we'll return an error here so we try again.
return nil, fmt.Errorf("cannot delete missing hint while getting next notification hint: %w", err)
return nil, store.NewErrNotFound(hint.BlockID)
}
}