Skip to content

Commit

Permalink
Created a seperate listWithRing for services that has a hashring (cad…
Browse files Browse the repository at this point in the history
…ence-workflow#6350)

What changed?
Created a seperate list of services that has a hashring.
Use the new list in places where we assume services has a hashring

Why?
We assumed in a few places that all services has a hash ring. Shard manager does not have a hash ring, and we do not want to create one.

How did you test it?
Unit tests, and local manual testing

Potential risks

Release notes

Documentation Changes
  • Loading branch information
jakobht authored Oct 10, 2024
1 parent 5915fed commit 4b9223d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 1 addition & 6 deletions common/membership/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,7 @@ func NewResolver(
logger log.Logger,
metrics metrics.Client,
) (*MultiringResolver, error) {
return NewMultiringResolver([]string{
service.Frontend,
service.Worker,
service.Matching,
service.History,
}, provider, logger.WithTags(tag.ComponentServiceResolver), metrics), nil
return NewMultiringResolver(service.ListWithRing, provider, logger.WithTags(tag.ComponentServiceResolver), metrics), nil
}

// NewMultiringResolver creates hashrings for all services
Expand Down
3 changes: 3 additions & 0 deletions common/service/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const (
ShardManager = "cadence-shard-manager"
)

// ListWithRing contains the list of all cadence services that has a hash ring
var ListWithRing = []string{Frontend, History, Matching, Worker}

// List contains the list of all cadence services
var List = []string{Frontend, History, Matching, Worker, ShardManager}

Expand Down
2 changes: 1 addition & 1 deletion service/frontend/admin/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ func (adh *adminHandlerImpl) DescribeCluster(
}

var rings []*types.RingInfo
for _, role := range service.List {
for _, role := range service.ListWithRing {
var servers []*types.HostInfo
members, err := monitor.Members(role)
if err != nil {
Expand Down

0 comments on commit 4b9223d

Please sign in to comment.