From c6f10a65981dbbd47e1468953e2399f8f797652a Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Thu, 18 May 2023 14:39:36 +0800 Subject: [PATCH] *: unify import path format and rename the store meta functions (#6481) ref tikv/pd#5839, ref tikv/pd#6418 Signed-off-by: Ryan Leung --- cmd/pd-server/main.go | 2 +- .../server/grpc_service.go | 0 .../server/install/install.go | 2 +- .../server/manager.go | 0 .../server/apis/v1/api.go | 2 +- .../server/config.go | 0 .../server/config_test.go | 0 .../server/grpc_service.go | 0 .../server/install/install.go | 4 ++-- .../server/manager.go | 0 .../server/metrics.go | 0 .../server/resource_group.go | 0 .../server/resource_group_test.go | 0 .../server/server.go | 0 .../server/testutil.go | 0 .../server/token_buckets_test.go | 0 .../server/token_bukets.go | 0 pkg/storage/endpoint/meta.go | 18 +++++++++--------- pkg/storage/storage_test.go | 8 ++++---- server/cluster/cluster.go | 8 ++++---- server/cluster/cluster_test.go | 2 +- server/config/config.go | 2 +- .../{region_syncer => regionsyncer}/client.go | 0 .../client_test.go | 0 .../history_buffer.go | 0 .../history_buffer_test.go | 0 .../{region_syncer => regionsyncer}/metrics.go | 0 .../{region_syncer => regionsyncer}/server.go | 0 server/server.go | 10 +++++----- .../resource_manager_test.go | 18 +++++++++--------- .../server_test.go | 0 tests/server/cluster/cluster_test.go | 6 +++--- 32 files changed, 41 insertions(+), 41 deletions(-) rename pkg/mcs/{meta_storage => metastorage}/server/grpc_service.go (100%) rename pkg/mcs/{meta_storage => metastorage}/server/install/install.go (93%) rename pkg/mcs/{meta_storage => metastorage}/server/manager.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/apis/v1/api.go (98%) rename pkg/mcs/{resource_manager => resourcemanager}/server/config.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/config_test.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/grpc_service.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/install/install.go (87%) rename pkg/mcs/{resource_manager => resourcemanager}/server/manager.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/metrics.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/resource_group.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/resource_group_test.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/server.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/testutil.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/token_buckets_test.go (100%) rename pkg/mcs/{resource_manager => resourcemanager}/server/token_bukets.go (100%) rename server/{region_syncer => regionsyncer}/client.go (100%) rename server/{region_syncer => regionsyncer}/client_test.go (100%) rename server/{region_syncer => regionsyncer}/history_buffer.go (100%) rename server/{region_syncer => regionsyncer}/history_buffer_test.go (100%) rename server/{region_syncer => regionsyncer}/metrics.go (100%) rename server/{region_syncer => regionsyncer}/server.go (100%) rename tests/integrations/mcs/{resource_manager => resourcemanager}/resource_manager_test.go (98%) rename tests/integrations/mcs/{resource_manager => resourcemanager}/server_test.go (100%) diff --git a/cmd/pd-server/main.go b/cmd/pd-server/main.go index 6fb8a3cdde2..f65a42ba551 100644 --- a/cmd/pd-server/main.go +++ b/cmd/pd-server/main.go @@ -27,7 +27,7 @@ import ( "github.com/tikv/pd/pkg/autoscaling" "github.com/tikv/pd/pkg/dashboard" "github.com/tikv/pd/pkg/errs" - resource_manager "github.com/tikv/pd/pkg/mcs/resource_manager/server" + resource_manager "github.com/tikv/pd/pkg/mcs/resourcemanager/server" tso "github.com/tikv/pd/pkg/mcs/tso/server" "github.com/tikv/pd/pkg/schedule/schedulers" "github.com/tikv/pd/pkg/swaggerserver" diff --git a/pkg/mcs/meta_storage/server/grpc_service.go b/pkg/mcs/metastorage/server/grpc_service.go similarity index 100% rename from pkg/mcs/meta_storage/server/grpc_service.go rename to pkg/mcs/metastorage/server/grpc_service.go diff --git a/pkg/mcs/meta_storage/server/install/install.go b/pkg/mcs/metastorage/server/install/install.go similarity index 93% rename from pkg/mcs/meta_storage/server/install/install.go rename to pkg/mcs/metastorage/server/install/install.go index f7efda1322a..defc24d5f99 100644 --- a/pkg/mcs/meta_storage/server/install/install.go +++ b/pkg/mcs/metastorage/server/install/install.go @@ -15,7 +15,7 @@ package install import ( - ms_server "github.com/tikv/pd/pkg/mcs/meta_storage/server" + ms_server "github.com/tikv/pd/pkg/mcs/metastorage/server" "github.com/tikv/pd/pkg/mcs/registry" ) diff --git a/pkg/mcs/meta_storage/server/manager.go b/pkg/mcs/metastorage/server/manager.go similarity index 100% rename from pkg/mcs/meta_storage/server/manager.go rename to pkg/mcs/metastorage/server/manager.go diff --git a/pkg/mcs/resource_manager/server/apis/v1/api.go b/pkg/mcs/resourcemanager/server/apis/v1/api.go similarity index 98% rename from pkg/mcs/resource_manager/server/apis/v1/api.go rename to pkg/mcs/resourcemanager/server/apis/v1/api.go index 39ed3c9cba0..1b50fa1bf21 100644 --- a/pkg/mcs/resource_manager/server/apis/v1/api.go +++ b/pkg/mcs/resourcemanager/server/apis/v1/api.go @@ -25,7 +25,7 @@ import ( "github.com/gin-gonic/gin" "github.com/joho/godotenv" rmpb "github.com/pingcap/kvproto/pkg/resource_manager" - rmserver "github.com/tikv/pd/pkg/mcs/resource_manager/server" + rmserver "github.com/tikv/pd/pkg/mcs/resourcemanager/server" "github.com/tikv/pd/pkg/mcs/utils" "github.com/tikv/pd/pkg/utils/apiutil" "github.com/tikv/pd/pkg/utils/apiutil/multiservicesapi" diff --git a/pkg/mcs/resource_manager/server/config.go b/pkg/mcs/resourcemanager/server/config.go similarity index 100% rename from pkg/mcs/resource_manager/server/config.go rename to pkg/mcs/resourcemanager/server/config.go diff --git a/pkg/mcs/resource_manager/server/config_test.go b/pkg/mcs/resourcemanager/server/config_test.go similarity index 100% rename from pkg/mcs/resource_manager/server/config_test.go rename to pkg/mcs/resourcemanager/server/config_test.go diff --git a/pkg/mcs/resource_manager/server/grpc_service.go b/pkg/mcs/resourcemanager/server/grpc_service.go similarity index 100% rename from pkg/mcs/resource_manager/server/grpc_service.go rename to pkg/mcs/resourcemanager/server/grpc_service.go diff --git a/pkg/mcs/resource_manager/server/install/install.go b/pkg/mcs/resourcemanager/server/install/install.go similarity index 87% rename from pkg/mcs/resource_manager/server/install/install.go rename to pkg/mcs/resourcemanager/server/install/install.go index e8410f12b3b..89a4ac1914f 100644 --- a/pkg/mcs/resource_manager/server/install/install.go +++ b/pkg/mcs/resourcemanager/server/install/install.go @@ -16,10 +16,10 @@ package install import ( "github.com/tikv/pd/pkg/mcs/registry" - rm_server "github.com/tikv/pd/pkg/mcs/resource_manager/server" + rm_server "github.com/tikv/pd/pkg/mcs/resourcemanager/server" // init API group - _ "github.com/tikv/pd/pkg/mcs/resource_manager/server/apis/v1" + _ "github.com/tikv/pd/pkg/mcs/resourcemanager/server/apis/v1" ) func init() { diff --git a/pkg/mcs/resource_manager/server/manager.go b/pkg/mcs/resourcemanager/server/manager.go similarity index 100% rename from pkg/mcs/resource_manager/server/manager.go rename to pkg/mcs/resourcemanager/server/manager.go diff --git a/pkg/mcs/resource_manager/server/metrics.go b/pkg/mcs/resourcemanager/server/metrics.go similarity index 100% rename from pkg/mcs/resource_manager/server/metrics.go rename to pkg/mcs/resourcemanager/server/metrics.go diff --git a/pkg/mcs/resource_manager/server/resource_group.go b/pkg/mcs/resourcemanager/server/resource_group.go similarity index 100% rename from pkg/mcs/resource_manager/server/resource_group.go rename to pkg/mcs/resourcemanager/server/resource_group.go diff --git a/pkg/mcs/resource_manager/server/resource_group_test.go b/pkg/mcs/resourcemanager/server/resource_group_test.go similarity index 100% rename from pkg/mcs/resource_manager/server/resource_group_test.go rename to pkg/mcs/resourcemanager/server/resource_group_test.go diff --git a/pkg/mcs/resource_manager/server/server.go b/pkg/mcs/resourcemanager/server/server.go similarity index 100% rename from pkg/mcs/resource_manager/server/server.go rename to pkg/mcs/resourcemanager/server/server.go diff --git a/pkg/mcs/resource_manager/server/testutil.go b/pkg/mcs/resourcemanager/server/testutil.go similarity index 100% rename from pkg/mcs/resource_manager/server/testutil.go rename to pkg/mcs/resourcemanager/server/testutil.go diff --git a/pkg/mcs/resource_manager/server/token_buckets_test.go b/pkg/mcs/resourcemanager/server/token_buckets_test.go similarity index 100% rename from pkg/mcs/resource_manager/server/token_buckets_test.go rename to pkg/mcs/resourcemanager/server/token_buckets_test.go diff --git a/pkg/mcs/resource_manager/server/token_bukets.go b/pkg/mcs/resourcemanager/server/token_bukets.go similarity index 100% rename from pkg/mcs/resource_manager/server/token_bukets.go rename to pkg/mcs/resourcemanager/server/token_bukets.go diff --git a/pkg/storage/endpoint/meta.go b/pkg/storage/endpoint/meta.go index ed6a9d9ebd6..4ba9eb42c5c 100644 --- a/pkg/storage/endpoint/meta.go +++ b/pkg/storage/endpoint/meta.go @@ -32,11 +32,11 @@ import ( type MetaStorage interface { LoadMeta(meta *metapb.Cluster) (bool, error) SaveMeta(meta *metapb.Cluster) error - LoadStore(storeID uint64, store *metapb.Store) (bool, error) - SaveStore(store *metapb.Store) error + LoadStoreMeta(storeID uint64, store *metapb.Store) (bool, error) + SaveStoreMeta(store *metapb.Store) error SaveStoreWeight(storeID uint64, leader, region float64) error LoadStores(f func(store *core.StoreInfo)) error - DeleteStore(store *metapb.Store) error + DeleteStoreMeta(store *metapb.Store) error RegionStorage } @@ -71,13 +71,13 @@ func (se *StorageEndpoint) SaveMeta(meta *metapb.Cluster) error { return se.saveProto(clusterPath, meta) } -// LoadStore loads one store from storage. -func (se *StorageEndpoint) LoadStore(storeID uint64, store *metapb.Store) (bool, error) { +// LoadStoreMeta loads one store from storage. +func (se *StorageEndpoint) LoadStoreMeta(storeID uint64, store *metapb.Store) (bool, error) { return se.loadProto(StorePath(storeID), store) } -// SaveStore saves one store to storage. -func (se *StorageEndpoint) SaveStore(store *metapb.Store) error { +// SaveStoreMeta saves one store to storage. +func (se *StorageEndpoint) SaveStoreMeta(store *metapb.Store) error { return se.saveProto(StorePath(store.GetId()), store) } @@ -146,8 +146,8 @@ func (se *StorageEndpoint) loadFloatWithDefaultValue(path string, def float64) ( return val, nil } -// DeleteStore deletes one store from storage. -func (se *StorageEndpoint) DeleteStore(store *metapb.Store) error { +// DeleteStoreMeta deletes one store from storage. +func (se *StorageEndpoint) DeleteStoreMeta(store *metapb.Store) error { return se.Remove(StorePath(store.GetId())) } diff --git a/pkg/storage/storage_test.go b/pkg/storage/storage_test.go index 9213aeb6026..dd14036855c 100644 --- a/pkg/storage/storage_test.go +++ b/pkg/storage/storage_test.go @@ -52,12 +52,12 @@ func TestBasic(t *testing.T) { re.Equal(meta, newMeta) store := &metapb.Store{Id: 123} - ok, err = storage.LoadStore(123, store) + ok, err = storage.LoadStoreMeta(123, store) re.False(ok) re.NoError(err) - re.NoError(storage.SaveStore(store)) + re.NoError(storage.SaveStoreMeta(store)) newStore := &metapb.Store{} - ok, err = storage.LoadStore(123, newStore) + ok, err = storage.LoadStoreMeta(123, newStore) re.True(ok) re.NoError(err) re.Equal(store, newStore) @@ -87,7 +87,7 @@ func mustSaveStores(re *require.Assertions, s Storage, n int) []*metapb.Store { } for _, store := range stores { - re.NoError(s.SaveStore(store)) + re.NoError(s.SaveStoreMeta(store)) } return stores diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index 3831cc4b071..1140cfcddf4 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -58,7 +58,7 @@ import ( "github.com/tikv/pd/pkg/utils/typeutil" "github.com/tikv/pd/pkg/versioninfo" "github.com/tikv/pd/server/config" - syncer "github.com/tikv/pd/server/region_syncer" + syncer "github.com/tikv/pd/server/regionsyncer" "github.com/tikv/pd/server/replication" "go.etcd.io/etcd/clientv3" "go.uber.org/zap" @@ -896,7 +896,7 @@ func (c *RaftCluster) HandleStoreHeartbeat(heartbeat *pdpb.StoreHeartbeatRequest zap.Uint64("available", newStore.GetAvailable())) } if newStore.NeedPersist() && c.storage != nil { - if err := c.storage.SaveStore(newStore.GetMeta()); err != nil { + if err := c.storage.SaveStoreMeta(newStore.GetMeta()); err != nil { log.Error("failed to persist store", zap.Uint64("store-id", storeID), errs.ZapError(err)) } else { newStore = newStore.Clone(core.SetLastPersistTime(nowTime)) @@ -1718,7 +1718,7 @@ func (c *RaftCluster) SetStoreWeight(storeID uint64, leaderWeight, regionWeight func (c *RaftCluster) putStoreLocked(store *core.StoreInfo) error { if c.storage != nil { - if err := c.storage.SaveStore(store.GetMeta()); err != nil { + if err := c.storage.SaveStoreMeta(store.GetMeta()); err != nil { return err } } @@ -2062,7 +2062,7 @@ func (c *RaftCluster) RemoveTombStoneRecords() error { // deleteStore deletes the store from the cluster. it's concurrent safe. func (c *RaftCluster) deleteStore(store *core.StoreInfo) error { if c.storage != nil { - if err := c.storage.DeleteStore(store.GetMeta()); err != nil { + if err := c.storage.DeleteStoreMeta(store.GetMeta()); err != nil { return err } } diff --git a/server/cluster/cluster_test.go b/server/cluster/cluster_test.go index 62ba7b53391..9c70e7afb15 100644 --- a/server/cluster/cluster_test.go +++ b/server/cluster/cluster_test.go @@ -95,7 +95,7 @@ func TestStoreHeartbeat(t *testing.T) { for i, store := range stores { tmp := &metapb.Store{} - ok, err := cluster.storage.LoadStore(store.GetID(), tmp) + ok, err := cluster.storage.LoadStoreMeta(store.GetID(), tmp) re.True(ok) re.NoError(err) re.Equal(storeMetasAfterHeartbeat[i], tmp) diff --git a/server/config/config.go b/server/config/config.go index 5ece87b95df..0b67087a121 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -29,7 +29,7 @@ import ( "github.com/spf13/pflag" "github.com/tikv/pd/pkg/core/storelimit" "github.com/tikv/pd/pkg/errs" - rm "github.com/tikv/pd/pkg/mcs/resource_manager/server" + rm "github.com/tikv/pd/pkg/mcs/resourcemanager/server" "github.com/tikv/pd/pkg/utils/configutil" "github.com/tikv/pd/pkg/utils/grpcutil" "github.com/tikv/pd/pkg/utils/metricutil" diff --git a/server/region_syncer/client.go b/server/regionsyncer/client.go similarity index 100% rename from server/region_syncer/client.go rename to server/regionsyncer/client.go diff --git a/server/region_syncer/client_test.go b/server/regionsyncer/client_test.go similarity index 100% rename from server/region_syncer/client_test.go rename to server/regionsyncer/client_test.go diff --git a/server/region_syncer/history_buffer.go b/server/regionsyncer/history_buffer.go similarity index 100% rename from server/region_syncer/history_buffer.go rename to server/regionsyncer/history_buffer.go diff --git a/server/region_syncer/history_buffer_test.go b/server/regionsyncer/history_buffer_test.go similarity index 100% rename from server/region_syncer/history_buffer_test.go rename to server/regionsyncer/history_buffer_test.go diff --git a/server/region_syncer/metrics.go b/server/regionsyncer/metrics.go similarity index 100% rename from server/region_syncer/metrics.go rename to server/regionsyncer/metrics.go diff --git a/server/region_syncer/server.go b/server/regionsyncer/server.go similarity index 100% rename from server/region_syncer/server.go rename to server/regionsyncer/server.go diff --git a/server/server.go b/server/server.go index a0b4d4de040..d60bcbaa3d5 100644 --- a/server/server.go +++ b/server/server.go @@ -50,11 +50,11 @@ import ( "github.com/tikv/pd/pkg/gc" "github.com/tikv/pd/pkg/id" "github.com/tikv/pd/pkg/keyspace" - ms_server "github.com/tikv/pd/pkg/mcs/meta_storage/server" + ms_server "github.com/tikv/pd/pkg/mcs/metastorage/server" "github.com/tikv/pd/pkg/mcs/registry" - rm_server "github.com/tikv/pd/pkg/mcs/resource_manager/server" - _ "github.com/tikv/pd/pkg/mcs/resource_manager/server/apis/v1" // init API group - _ "github.com/tikv/pd/pkg/mcs/tso/server/apis/v1" // init tso API group + rm_server "github.com/tikv/pd/pkg/mcs/resourcemanager/server" + _ "github.com/tikv/pd/pkg/mcs/resourcemanager/server/apis/v1" // init API group + _ "github.com/tikv/pd/pkg/mcs/tso/server/apis/v1" // init tso API group mcs "github.com/tikv/pd/pkg/mcs/utils" "github.com/tikv/pd/pkg/member" "github.com/tikv/pd/pkg/ratelimit" @@ -76,7 +76,7 @@ import ( "github.com/tikv/pd/pkg/versioninfo" "github.com/tikv/pd/server/cluster" "github.com/tikv/pd/server/config" - syncer "github.com/tikv/pd/server/region_syncer" + syncer "github.com/tikv/pd/server/regionsyncer" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/embed" "go.etcd.io/etcd/mvcc/mvccpb" diff --git a/tests/integrations/mcs/resource_manager/resource_manager_test.go b/tests/integrations/mcs/resourcemanager/resource_manager_test.go similarity index 98% rename from tests/integrations/mcs/resource_manager/resource_manager_test.go rename to tests/integrations/mcs/resourcemanager/resource_manager_test.go index 6dcc5dd6430..2c42043ca53 100644 --- a/tests/integrations/mcs/resource_manager/resource_manager_test.go +++ b/tests/integrations/mcs/resourcemanager/resource_manager_test.go @@ -30,14 +30,14 @@ import ( "github.com/stretchr/testify/suite" pd "github.com/tikv/pd/client" "github.com/tikv/pd/client/resource_group/controller" - "github.com/tikv/pd/pkg/mcs/resource_manager/server" + "github.com/tikv/pd/pkg/mcs/resourcemanager/server" "github.com/tikv/pd/pkg/utils/testutil" "github.com/tikv/pd/tests" "go.uber.org/goleak" // Register Service _ "github.com/tikv/pd/pkg/mcs/registry" - _ "github.com/tikv/pd/pkg/mcs/resource_manager/server/install" + _ "github.com/tikv/pd/pkg/mcs/resourcemanager/server/install" ) func TestMain(m *testing.M) { @@ -61,7 +61,7 @@ func (suite *resourceManagerClientTestSuite) SetupSuite() { var err error re := suite.Require() - re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resource_manager/server/enableDegradedMode", `return(true)`)) + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/enableDegradedMode", `return(true)`)) suite.ctx, suite.clean = context.WithCancel(context.Background()) @@ -146,7 +146,7 @@ func (suite *resourceManagerClientTestSuite) TearDownSuite() { suite.client.Close() suite.cluster.Destroy() suite.clean() - re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resource_manager/server/enableDegradedMode")) + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/enableDegradedMode")) } func (suite *resourceManagerClientTestSuite) TearDownTest() { @@ -599,7 +599,7 @@ func (suite *resourceManagerClientTestSuite) TestAcquireTokenBucket() { Requests: make([]*rmpb.TokenBucketRequest, 0), TargetRequestPeriodMs: uint64(time.Second * 10 / time.Millisecond), } - re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resource_manager/server/fastPersist", `return(true)`)) + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/fastPersist", `return(true)`)) suite.resignAndWaitLeader() groups = append(groups, &rmpb.ResourceGroup{Name: "test3"}) for i := 0; i < 3; i++ { @@ -647,7 +647,7 @@ func (suite *resourceManagerClientTestSuite) TestAcquireTokenBucket() { re.NoError(err) checkFunc(gresp, groups[0]) } - re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resource_manager/server/fastPersist")) + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/fastPersist")) } func (suite *resourceManagerClientTestSuite) TestBasicResourceGroupCURD() { @@ -965,7 +965,7 @@ func (suite *resourceManagerClientTestSuite) TestResourceManagerClientDegradedMo WriteCostPerByte: 1, CPUMsCost: 1, } - re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resource_manager/server/acquireFailed", `return(true)`)) + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/acquireFailed", `return(true)`)) re.NoError(failpoint.Enable("github.com/tikv/pd/client/resource_group/controller/degradedModeRU", "return(true)")) controller, _ := controller.NewResourceGroupController(suite.ctx, 1, cli, cfg) controller.Start(suite.ctx) @@ -991,7 +991,7 @@ func (suite *resourceManagerClientTestSuite) TestResourceManagerClientDegradedMo // we can not check `inDegradedMode` because of data race. re.True(endTime.Before(beginTime.Add(time.Second))) controller.Stop() - re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resource_manager/server/acquireFailed")) + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/acquireFailed")) re.NoError(failpoint.Disable("github.com/tikv/pd/client/resource_group/controller/degradedModeRU")) } @@ -1029,7 +1029,7 @@ func (suite *resourceManagerClientTestSuite) TestLoadRequestUnitConfig() { re.Equal(expectedConfig.WriteBaseCost, config.WriteBaseCost) re.Equal(expectedConfig.WriteBytesCost, config.WriteBytesCost) re.Equal(expectedConfig.CPUMsCost, config.CPUMsCost) - // refer github.com/tikv/pd/pkg/mcs/resource_manager/server/enableDegradedMode, check with 1s. + // refer github.com/tikv/pd/pkg/mcs/resourcemanager/server/enableDegradedMode, check with 1s. re.Equal(time.Second, config.DegradedModeWaitDuration) } diff --git a/tests/integrations/mcs/resource_manager/server_test.go b/tests/integrations/mcs/resourcemanager/server_test.go similarity index 100% rename from tests/integrations/mcs/resource_manager/server_test.go rename to tests/integrations/mcs/resourcemanager/server_test.go diff --git a/tests/server/cluster/cluster_test.go b/tests/server/cluster/cluster_test.go index b576ef08b64..1ab458fa742 100644 --- a/tests/server/cluster/cluster_test.go +++ b/tests/server/cluster/cluster_test.go @@ -44,7 +44,7 @@ import ( "github.com/tikv/pd/server" "github.com/tikv/pd/server/cluster" "github.com/tikv/pd/server/config" - syncer "github.com/tikv/pd/server/region_syncer" + syncer "github.com/tikv/pd/server/regionsyncer" "github.com/tikv/pd/tests" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -831,7 +831,7 @@ func TestLoadClusterInfo(t *testing.T) { } for _, store := range stores { - re.NoError(testStorage.SaveStore(store)) + re.NoError(testStorage.SaveStoreMeta(store)) } regions := make([]*metapb.Region, 0, n) @@ -1450,7 +1450,7 @@ func TestTransferLeaderBack(t *testing.T) { } for _, store := range stores { - re.NoError(storage.SaveStore(store)) + re.NoError(storage.SaveStoreMeta(store)) } rc, err = rc.LoadClusterInfo() re.NoError(err)