feat: when the cache is missing, change the error log to a warning log (#2235)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
7900835c48
commit
4f65acf24e
|
|
@ -98,7 +98,7 @@ func (s *managerServerV1) GetSeedPeer(ctx context.Context, req *managerv1.GetSee
|
|||
// Cache hit.
|
||||
var pbSeedPeer managerv1.SeedPeer
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbSeedPeer); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbSeedPeer, nil
|
||||
|
|
@ -270,7 +270,7 @@ func (s *managerServerV1) GetScheduler(ctx context.Context, req *managerv1.GetSc
|
|||
// Cache hit.
|
||||
var pbScheduler managerv1.Scheduler
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbScheduler); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbScheduler, nil
|
||||
|
|
@ -487,7 +487,7 @@ func (s *managerServerV1) ListSchedulers(ctx context.Context, req *managerv1.Lis
|
|||
cacheKey := cache.MakeSchedulersCacheKeyForPeer(req.Hostname, req.Ip)
|
||||
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbListSchedulersResponse); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbListSchedulersResponse, nil
|
||||
|
|
@ -630,7 +630,7 @@ func (s *managerServerV1) ListBuckets(ctx context.Context, req *managerv1.ListBu
|
|||
|
||||
// Cache hit.
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbListBucketsResponse); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbListBucketsResponse, nil
|
||||
|
|
@ -670,7 +670,7 @@ func (s *managerServerV1) ListApplications(ctx context.Context, req *managerv1.L
|
|||
var pbListApplicationsResponse managerv1.ListApplicationsResponse
|
||||
cacheKey := cache.MakeApplicationsCacheKey()
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbListApplicationsResponse); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbListApplicationsResponse, nil
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ func (s *managerServerV2) GetSeedPeer(ctx context.Context, req *managerv2.GetSee
|
|||
// Cache hit.
|
||||
var pbSeedPeer managerv2.SeedPeer
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbSeedPeer); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbSeedPeer, nil
|
||||
|
|
@ -270,7 +270,7 @@ func (s *managerServerV2) GetScheduler(ctx context.Context, req *managerv2.GetSc
|
|||
// Cache hit.
|
||||
var pbScheduler managerv2.Scheduler
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbScheduler); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbScheduler, nil
|
||||
|
|
@ -487,7 +487,7 @@ func (s *managerServerV2) ListSchedulers(ctx context.Context, req *managerv2.Lis
|
|||
cacheKey := cache.MakeSchedulersCacheKeyForPeer(req.Hostname, req.Ip)
|
||||
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbListSchedulersResponse); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbListSchedulersResponse, nil
|
||||
|
|
@ -629,7 +629,7 @@ func (s *managerServerV2) ListBuckets(ctx context.Context, req *managerv2.ListBu
|
|||
|
||||
// Cache hit.
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbListBucketsResponse); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbListBucketsResponse, nil
|
||||
|
|
@ -669,7 +669,7 @@ func (s *managerServerV2) ListApplications(ctx context.Context, req *managerv2.L
|
|||
var pbListApplicationsResponse managerv2.ListApplicationsResponse
|
||||
cacheKey := cache.MakeApplicationsCacheKey()
|
||||
if err := s.cache.Get(ctx, cacheKey, &pbListApplicationsResponse); err != nil {
|
||||
log.Errorf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
|
||||
} else {
|
||||
log.Debugf("%s cache hit", cacheKey)
|
||||
return &pbListApplicationsResponse, nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue