Skip to content

Commit

Permalink
Merge branch 'master' into min-ssl-version
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Aug 9, 2024
2 parents 2e87a2c + 6783814 commit 7d406ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions pkg/keyspace/tso_keyspace_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func (m *GroupManager) allocNodesToAllKeyspaceGroups(ctx context.Context) {
log.Error("failed to alloc nodes for keyspace group", zap.Uint32("keyspace-group-id", group.ID), zap.Error(err))
continue
}
log.Info("alloc nodes for keyspace group", zap.Uint32("keyspace-group-id", group.ID), zap.Any("nodes", nodes))
group.Members = nodes
}
}
Expand Down
32 changes: 17 additions & 15 deletions tests/integrations/mcs/tso/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,22 +598,24 @@ func (suite *CommonTestSuite) TestAdvertiseAddr() {
func (suite *CommonTestSuite) TestBootstrapDefaultKeyspaceGroup() {
re := suite.Require()

// check the default keyspace group
// check the default keyspace group and wait for alloc tso nodes for the default keyspace group
check := func() {
resp, err := tests.TestDialClient.Get(suite.pdLeader.GetServer().GetConfig().AdvertiseClientUrls + "/pd/api/v2/tso/keyspace-groups")
re.NoError(err)
defer resp.Body.Close()
re.Equal(http.StatusOK, resp.StatusCode)
respString, err := io.ReadAll(resp.Body)
re.NoError(err)
var kgs []*endpoint.KeyspaceGroup
re.NoError(json.Unmarshal(respString, &kgs))
re.Len(kgs, 1)
re.Equal(utils.DefaultKeyspaceGroupID, kgs[0].ID)
re.Equal(endpoint.Basic.String(), kgs[0].UserKind)
re.Empty(kgs[0].SplitState)
re.Empty(kgs[0].Members)
re.Empty(kgs[0].KeyspaceLookupTable)
testutil.Eventually(re, func() bool {
resp, err := tests.TestDialClient.Get(suite.pdLeader.GetServer().GetConfig().AdvertiseClientUrls + "/pd/api/v2/tso/keyspace-groups")
re.NoError(err)
defer resp.Body.Close()
re.Equal(http.StatusOK, resp.StatusCode)
respString, err := io.ReadAll(resp.Body)
re.NoError(err)
var kgs []*endpoint.KeyspaceGroup
re.NoError(json.Unmarshal(respString, &kgs))
re.Len(kgs, 1)
re.Equal(utils.DefaultKeyspaceGroupID, kgs[0].ID)
re.Equal(endpoint.Basic.String(), kgs[0].UserKind)
re.Empty(kgs[0].SplitState)
re.Empty(kgs[0].KeyspaceLookupTable)
return len(kgs[0].Members) == 1
})
}
check()

Expand Down

0 comments on commit 7d406ad

Please sign in to comment.