Skip to content
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

Provide GetMinTS API to solve the compatibility issue brought by multi-timeline tso #6421

Merged
merged 10 commits into from
May 12, 2023
Prev Previous commit
Next Next commit
fix bug
Signed-off-by: Bin Shi <binshi.bing@gmail.com>
  • Loading branch information
binshi-bing committed May 12, 2023
commit df42ef5dce8536b0cf12af3f70fe7bbb3557c068
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (c *client) setServiceMode(newMode pdpb.ServiceMode) {
}
newTSOCli.Setup()
// Replace the old TSO client.
oldTSOClient, _ := c.getServiceClientProxy()
oldTSOClient := c.tsoClient
c.tsoClient = newTSOCli
oldTSOClient.Close()
// Replace the old TSO service discovery if needed.
Expand Down
20 changes: 10 additions & 10 deletions pkg/mcs/tso/server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@ func (s *Service) Tso(stream tsopb.TSO_TsoServer) error {
func (s *Service) FindGroupByKeyspaceID(
ctx context.Context, request *tsopb.FindGroupByKeyspaceIDRequest,
) (*tsopb.FindGroupByKeyspaceIDResponse, error) {
if s.IsClosed() || s.keyspaceGroupManager == nil {
return &tsopb.FindGroupByKeyspaceIDResponse{
Header: s.wrapErrorToHeader(tsopb.ErrorType_NOT_BOOTSTRAPPED, ErrNotStarted.Error(), 0),
}, nil
}
// if s.IsClosed() || s.keyspaceGroupManager == nil {
// return &tsopb.FindGroupByKeyspaceIDResponse{
// Header: s.wrapErrorToHeader(tsopb.ErrorType_NOT_BOOTSTRAPPED, ErrNotStarted.Error(), 0),
// }, nil
// }

if request.GetHeader().GetClusterId() != s.clusterID {
return &tsopb.FindGroupByKeyspaceIDResponse{
Header: s.wrapErrorToHeader(tsopb.ErrorType_CLUSTER_MISMATCHED, ErrClusterMismatched.Error(), 0),
}, nil
}
// if request.GetHeader().GetClusterId() != s.clusterID {
// return &tsopb.FindGroupByKeyspaceIDResponse{
// Header: s.wrapErrorToHeader(tsopb.ErrorType_CLUSTER_MISMATCHED, ErrClusterMismatched.Error(), 0),
// }, nil
// }

keyspaceID := request.GetKeyspaceId()
am, keyspaceGroup, keyspaceGroupID, err := s.keyspaceGroupManager.FindGroupByKeyspaceID(keyspaceID)
Expand Down