Skip to content

Commit

Permalink
groupcache: reduce log severity (#5323)
Browse files Browse the repository at this point in the history
Sometimes certain operations can fail with some error(-s) being expected
e.g. a deletion marker might or might not exist. Thus, these log lines
could get triggered even though nothing bad is happening. Since the
expected errors are known only at the very end, near the call site, and
because `error`s are already logged in other places, and because these
Fetch()/Store() functions are working in best-effort scenario, I propose
reducing the severity of these log lines to `debug`.

Fixes #5265.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Signed-off-by: Wiard van Rij <wvanrij@roku.com>
  • Loading branch information
GiedriusS authored and wiardvanrij committed May 5, 2022
1 parent 460e85b commit d2738ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cache/groupcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ func (c *Groupcache) Fetch(ctx context.Context, keys []string) map[string][]byte
codec := galaxycache.ByteCodec{}

if err := c.galaxy.Get(ctx, k, &codec); err != nil {
level.Error(c.logger).Log("msg", "failed fetching data from groupcache", "err", err, "key", k)
level.Debug(c.logger).Log("msg", "failed fetching data from groupcache", "err", err, "key", k)
continue
}

retrievedData, _, err := codec.MarshalBinary()
if err != nil {
level.Error(c.logger).Log("msg", "failed retrieving data", "err", err, "key", k)
level.Debug(c.logger).Log("msg", "failed retrieving data", "err", err, "key", k)
continue
}

Expand Down

0 comments on commit d2738ab

Please sign in to comment.