-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge membership Monitor and ServiceResolver to membership.Resolver #4646
Merge membership Monitor and ServiceResolver to membership.Resolver #4646
Conversation
@@ -597,24 +597,22 @@ func (adh *adminHandlerImpl) DescribeCluster( | |||
|
|||
var rings []*types.RingInfo | |||
for _, role := range service.List { | |||
resolver, err := monitor.GetResolver(role) | |||
if err != nil { | |||
return nil, adh.error(err, scope) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we no longer return this error. Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed
7cb1433
to
4b2cffa
Compare
client/matching/peerResolver.go
Outdated
|
||
// PeerResolver is used to resolve matching peers. | ||
// Those are deployed instances of Cadence matching services that participate in the cluster ring. | ||
// The resulting peer is simply an address of form ip:port where RPC calls can be routed to. | ||
type PeerResolver struct { | ||
membership membership.ServiceResolver | ||
membership membership.Resolver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this was renamed to resolver
in client/history/peerResolver.go
, maybe rename here as well for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, can do
service/history/shard/controller.go
Outdated
@@ -163,7 +165,7 @@ func (c *controller) Start() { | |||
c.shutdownWG.Add(1) | |||
go c.shardManagementPump() | |||
|
|||
err := c.GetHistoryServiceResolver().AddListener(shardControllerMembershipUpdateListenerName, c.membershipUpdateCh) | |||
err := c.GetMembershipResolver().Subscribe(service.History, shardControllerMembershipUpdateListenerName, c.membershipUpdateCh) | |||
if err != nil { | |||
c.logger.Error("Error adding listener", tag.Error(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this error message, as this is not listener anymore, but a subscriber.
service/history/shard/controller.go
Outdated
@@ -178,7 +180,7 @@ func (c *controller) Stop() { | |||
|
|||
c.PrepareToStop() | |||
|
|||
if err := c.GetHistoryServiceResolver().RemoveListener(shardControllerMembershipUpdateListenerName); err != nil { | |||
if err := c.GetMembershipResolver().Unsubscribe(service.History, shardControllerMembershipUpdateListenerName); err != nil { | |||
c.logger.Error("Error removing membership update listener", tag.Error(err), tag.OperationFailed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this error as well, listener -> subscriber.
service/matching/matchingEngine.go
Outdated
@@ -109,7 +111,7 @@ func NewEngine(taskManager persistence.TaskManager, | |||
logger log.Logger, | |||
metricsClient metrics.Client, | |||
domainCache cache.DomainCache, | |||
resolver membership.ServiceResolver, | |||
monitor membership.Resolver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This var should be resolver
@@ -55,7 +76,7 @@ func newDomainReplicationProcessor( | |||
metricsClient metrics.Client, | |||
taskExecutor domain.ReplicationTaskExecutor, | |||
hostInfo *membership.HostInfo, | |||
serviceResolver membership.ServiceResolver, | |||
membership membership.Resolver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename to resolver
for consistency with other places
common/membership/hashring.go
Outdated
event.HostsUpdated = append(event.HostsUpdated, NewHostInfo(addr, r.getLabelsMap())) | ||
} | ||
|
||
// Notify listeners |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listeners -> subscribers
940cc26
to
fcf7287
Compare
What changed?
Membership monitor and service resolver interfaces merged to a single
membership.Resolver
interface.Resolver
is using hashring to get ownership for a shard.Why?
This is part of refactoring needed to introduce selectable membership providers.
How did you test it?
Unit test/local test
Potential risks
Release notes
Documentation Changes