diff --git a/pkg/tso/allocator_manager.go b/pkg/tso/allocator_manager.go index a8bc69d5426..61b08599b5c 100644 --- a/pkg/tso/allocator_manager.go +++ b/pkg/tso/allocator_manager.go @@ -136,7 +136,6 @@ type AllocatorManager struct { // member is for election use member ElectionMember // TSO config - rootPath string storage endpoint.TSOStorage saveInterval time.Duration updatePhysicalInterval time.Duration diff --git a/pkg/utils/keypath/absolute_key_path.go b/pkg/utils/keypath/absolute_key_path.go index 5ca3f882996..a3e9fef13ea 100644 --- a/pkg/utils/keypath/absolute_key_path.go +++ b/pkg/utils/keypath/absolute_key_path.go @@ -169,6 +169,7 @@ func ExternalTimestampPath() string { return fmt.Sprintf(externalTimestampPathFormat, ClusterID()) } +// RecoveringMarkPath returns the path to save the recovering mark. func RecoveringMarkPath() string { return fmt.Sprintf(recoveringMarkPathFormat, ClusterID()) } diff --git a/tests/server/api/scheduler_test.go b/tests/server/api/scheduler_test.go index 22e84633045..1f36888b277 100644 --- a/tests/server/api/scheduler_test.go +++ b/tests/server/api/scheduler_test.go @@ -113,7 +113,7 @@ func (suite *scheduleTestSuite) checkOriginAPI(cluster *tests.TestCluster) { suite.assertSchedulerExists(urlPrefix, "evict-leader-scheduler") resp := make(map[string]any) - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, "evict-leader-scheduler") + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, "evict-leader-scheduler") re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp)) re.Len(resp["store-id-ranges"], 1) input1 := make(map[string]any) @@ -186,7 +186,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { name: "balance-leader-scheduler", createdName: "balance-leader-scheduler", extraTestFunc: func(name string) { - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) resp := make(map[string]any) tu.Eventually(re, func() bool { re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp)) @@ -194,7 +194,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { }) dataMap := make(map[string]any) dataMap["batch"] = 3 - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(dataMap) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -244,7 +244,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { createdName: "balance-hot-region-scheduler", extraTestFunc: func(name string) { resp := make(map[string]any) - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) expectMap := map[string]any{ "min-hot-byte-rate": 100.0, "min-hot-key-rate": 10.0, @@ -283,7 +283,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { dataMap := make(map[string]any) dataMap["max-zombie-rounds"] = 5.0 expectMap["max-zombie-rounds"] = 5.0 - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(dataMap) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -318,7 +318,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { name: "split-bucket-scheduler", createdName: "split-bucket-scheduler", extraTestFunc: func(name string) { - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) resp := make(map[string]any) tu.Eventually(re, func() bool { re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp)) @@ -326,7 +326,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { }) dataMap := make(map[string]any) dataMap["degree"] = 4 - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(dataMap) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -377,14 +377,14 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { createdName: "balance-witness-scheduler", extraTestFunc: func(name string) { resp := make(map[string]any) - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) tu.Eventually(re, func() bool { re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp)) return resp["batch"] == 4.0 }) dataMap := make(map[string]any) dataMap["batch"] = 3 - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(dataMap) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -434,7 +434,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { args: []arg{{"store_id", 1}}, extraTestFunc: func(name string) { resp := make(map[string]any) - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) expectedMap := make(map[string]any) expectedMap["1"] = []any{map[string]any{"end-key": "", "start-key": ""}} tu.Eventually(re, func() bool { @@ -446,7 +446,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { input := make(map[string]any) input["name"] = "grant-leader-scheduler" input["store_id"] = 2 - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(input) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -458,7 +458,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { }) // using /pd/v1/schedule-config/grant-leader-scheduler/config to delete exists store from grant-leader-scheduler - deleteURL := fmt.Sprintf("%s%s%s/%s/delete/%s", leaderAddr, server.SchedulerConfigHandlerPath, name, "2") + deleteURL := fmt.Sprintf("%s%s/%s/delete/%s", leaderAddr, server.SchedulerConfigHandlerPath, name, "2") err = tu.CheckDelete(tests.TestDialClient, deleteURL, tu.StatusOK(re)) re.NoError(err) delete(expectedMap, "2") @@ -478,14 +478,14 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { // Test the scheduler config handler. extraTestFunc: func(name string) { resp := make(map[string]any) - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) tu.Eventually(re, func() bool { re.NoError(tu.ReadGetJSON(re, tests.TestDialClient, listURL, &resp)) return resp["start-key"] == "" && resp["end-key"] == "" && resp["range-name"] == "test" }) resp["start-key"] = "a_00" resp["end-key"] = "a_99" - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(resp) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -503,7 +503,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { // Test the scheduler config handler. extraTestFunc: func(name string) { resp := make(map[string]any) - listURL := fmt.Sprintf("%s%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) + listURL := fmt.Sprintf("%s%s/%s/list", leaderAddr, server.SchedulerConfigHandlerPath, name) expectedMap := make(map[string]any) expectedMap["3"] = []any{map[string]any{"end-key": "", "start-key": ""}} tu.Eventually(re, func() bool { @@ -515,7 +515,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { input := make(map[string]any) input["name"] = "evict-leader-scheduler" input["store_id"] = 4 - updateURL := fmt.Sprintf("%s%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) + updateURL := fmt.Sprintf("%s%s/%s/config", leaderAddr, server.SchedulerConfigHandlerPath, name) body, err := json.Marshal(input) re.NoError(err) re.NoError(tu.CheckPostJSON(tests.TestDialClient, updateURL, body, tu.StatusOK(re))) @@ -527,7 +527,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { }) // using /pd/v1/schedule-config/evict-leader-scheduler/config to delete exist store from evict-leader-scheduler - deleteURL := fmt.Sprintf("%s%s%s/%s/delete/%s", leaderAddr, server.SchedulerConfigHandlerPath, name, "4") + deleteURL := fmt.Sprintf("%s%s/%s/delete/%s", leaderAddr, server.SchedulerConfigHandlerPath, name, "4") err = tu.CheckDelete(tests.TestDialClient, deleteURL, tu.StatusOK(re)) re.NoError(err) delete(expectedMap, "4")