diff --git a/server/apiv2/handlers/tso_keyspace_group.go b/server/apiv2/handlers/tso_keyspace_group.go index b4149c23f03..6dafc98e603 100644 --- a/server/apiv2/handlers/tso_keyspace_group.go +++ b/server/apiv2/handlers/tso_keyspace_group.go @@ -461,11 +461,6 @@ func SetNodesForKeyspaceGroup(c *gin.Context) { c.AbortWithStatusJSON(http.StatusBadRequest, "keyspace group does not exist") return } - // check if nodes is less than default replica count - if len(setParams.Nodes) < utils.DefaultKeyspaceGroupReplicaCount { - c.AbortWithStatusJSON(http.StatusBadRequest, "invalid num of nodes") - return - } // check if node exists for _, node := range setParams.Nodes { if exist, _ := manager.IsExistNode(node); !exist { diff --git a/tests/integrations/mcs/keyspace/tso_keyspace_group_test.go b/tests/integrations/mcs/keyspace/tso_keyspace_group_test.go index 33e775211d2..715fbf825b9 100644 --- a/tests/integrations/mcs/keyspace/tso_keyspace_group_test.go +++ b/tests/integrations/mcs/keyspace/tso_keyspace_group_test.go @@ -280,7 +280,7 @@ func (suite *keyspaceGroupTestSuite) TestSetNodes() { Nodes: []string{nodesList[0]}, } _, code = suite.trySetNodesForKeyspaceGroup(re, id, params) - re.Equal(http.StatusBadRequest, code) + re.Equal(http.StatusOK, code) // the keyspace group is not exist. id = 2 diff --git a/tools/pd-ctl/tests/keyspace/keyspace_group_test.go b/tools/pd-ctl/tests/keyspace/keyspace_group_test.go index 5d85f35dacf..b999b1bd0fd 100644 --- a/tools/pd-ctl/tests/keyspace/keyspace_group_test.go +++ b/tools/pd-ctl/tests/keyspace/keyspace_group_test.go @@ -263,7 +263,7 @@ func TestSetNodeAndPriorityKeyspaceGroup(t *testing.T) { args := []string{"-u", pdAddr, "keyspace-group", "set-node", defaultKeyspaceGroupID, tsoAddrs[0]} output, err := tests.ExecuteCommand(cmd, args...) re.NoError(err) - re.Contains(string(output), "invalid num of nodes") + re.Contains(string(output), "Success!") args = []string{"-u", pdAddr, "keyspace-group", "set-node", defaultKeyspaceGroupID, "", ""} output, err = tests.ExecuteCommand(cmd, args...) re.NoError(err)