Skip to content

Commit

Permalink
feat: add client version for MakeSchedulersKeyForPeerInManager
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <gaius.qi@gmail.com>
  • Loading branch information
gaius-qi committed Dec 17, 2024
1 parent 6e4b473 commit 1677c19
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manager/rpcserver/manager_server_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func (s *managerServerV1) ListSchedulers(ctx context.Context, req *managerv1.Lis

// Cache hit.
var pbListSchedulersResponse managerv1.ListSchedulersResponse
cacheKey := pkgredis.MakeSchedulersKeyForPeerInManager(req.Hostname, req.Ip)
cacheKey := pkgredis.MakeSchedulersKeyForPeerInManager(req.Hostname, req.Ip, req.Version)

if err := s.cache.Get(ctx, cacheKey, &pbListSchedulersResponse); err != nil {
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
Expand Down
2 changes: 1 addition & 1 deletion manager/rpcserver/manager_server_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func (s *managerServerV2) ListSchedulers(ctx context.Context, req *managerv2.Lis

// Cache hit.
var pbListSchedulersResponse managerv2.ListSchedulersResponse
cacheKey := pkgredis.MakeSchedulersKeyForPeerInManager(req.Hostname, req.Ip)
cacheKey := pkgredis.MakeSchedulersKeyForPeerInManager(req.Hostname, req.Ip, req.Version)

if err := s.cache.Get(ctx, cacheKey, &pbListSchedulersResponse); err != nil {
log.Warnf("%s cache miss because of %s", cacheKey, err.Error())
Expand Down
4 changes: 2 additions & 2 deletions pkg/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ func MakeSeedPeersKeyForPeerInManager(hostname, ip string) string {
}

// MakeSchedulersKeyForPeerInManager make schedulers key for peer in manager.
func MakeSchedulersKeyForPeerInManager(hostname, ip string) string {
return MakeKeyInManager(PeersNamespace, fmt.Sprintf("%s-%s:schedulers", hostname, ip))
func MakeSchedulersKeyForPeerInManager(hostname, ip, version string) string {
return MakeKeyInManager(PeersNamespace, fmt.Sprintf("%s-%s-%s:schedulers", hostname, ip, version))
}

// MakeSchedulerClusterKeyInManager make distributed rate limiter key in manager.
Expand Down

0 comments on commit 1677c19

Please sign in to comment.