Skip to content

Commit

Permalink
Log tso service discovery info on the client side only when the prima…
Browse files Browse the repository at this point in the history
…ry is changed.

Skip logging of the tso service discovery info when the secondar list is changed, because tso servers currently don't have consistent view of the member list due to remote etcd being used by tso service.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
  • Loading branch information
binshi-bing committed May 24, 2023
1 parent b45378a commit bef5471
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions client/tso_service_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,17 +488,15 @@ func (c *tsoServiceDiscovery) updateMember() error {
}
}

oldPrimary, primarySwitched, secondaryChanged :=
oldPrimary, primarySwitched, _ :=
c.keyspaceGroupSD.update(keyspaceGroup, primaryAddr, secondaryAddrs, addrs)
if primarySwitched {
log.Info("[tso] updated keyspace group service discovery info",
zap.String("keyspace-group-service", keyspaceGroup.String()))
if err := c.afterPrimarySwitched(oldPrimary, primaryAddr); err != nil {
return err
}
}
if primarySwitched || secondaryChanged {
log.Info("[tso] updated keyspace group service discovery info",
zap.String("keyspace-group-service", keyspaceGroup.String()))
}

// Even if the primary address is empty, we still updated other returned info above, including the
// keyspace group info and the secondary addresses.
Expand Down

0 comments on commit bef5471

Please sign in to comment.