diff --git a/domain/domain.go b/domain/domain.go index 20a01ba51f2c4..0d06fdc5a7a13 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -613,7 +613,7 @@ func (do *Domain) globalConfigSyncerKeeper() { for { select { case entry := <-do.globalCfgSyncer.NotifyCh: - err := do.globalCfgSyncer.StoreGlobalConfig(context.Background(), "/global/config/", entry) + err := do.globalCfgSyncer.StoreGlobalConfig(context.Background(), entry) if err != nil { logutil.BgLogger().Error("global config syncer store failed", zap.Error(err)) } diff --git a/domain/globalconfigsync/globalconfig.go b/domain/globalconfigsync/globalconfig.go index 8da067f69dcdd..020e5dde8491c 100644 --- a/domain/globalconfigsync/globalconfig.go +++ b/domain/globalconfigsync/globalconfig.go @@ -40,7 +40,7 @@ func NewGlobalConfigSyncer(p pd.Client) *GlobalConfigSyncer { } // StoreGlobalConfig is used to store global config. -func (s *GlobalConfigSyncer) StoreGlobalConfig(ctx context.Context, configPath string, item pd.GlobalConfigItem) error { +func (s *GlobalConfigSyncer) StoreGlobalConfig(ctx context.Context, item pd.GlobalConfigItem) error { if s.pd == nil { return nil } @@ -48,7 +48,7 @@ func (s *GlobalConfigSyncer) StoreGlobalConfig(ctx context.Context, configPath s if err != nil { return err } - logutil.BgLogger().Info("store global config", zap.String("name", item.Name), zap.String("path", configPath), zap.String("value", item.Value)) + logutil.BgLogger().Info("store global config", zap.String("name", item.Name), zap.String("value", item.Value)) return nil } diff --git a/sessionctx/variable/sysvar_test.go b/sessionctx/variable/sysvar_test.go index 7565067b4e2a6..75f60659d9775 100644 --- a/sessionctx/variable/sysvar_test.go +++ b/sessionctx/variable/sysvar_test.go @@ -987,6 +987,7 @@ func TestTiDBServerMemoryLimitSessMinSize(t *testing.T) { serverMemroyLimitSessMinSize := GetSysVar(TiDBServerMemoryLimitSessMinSize) // Check default value require.Equal(t, serverMemroyLimitSessMinSize.Value, strconv.FormatInt(DefTiDBServerMemoryLimitSessMinSize, 10)) + err = mock.SetGlobalSysVar(context.Background(), TiDBServerMemoryLimitSessMinSize, "123456") require.NoError(t, err) val, err = mock.GetGlobalSysVar(TiDBServerMemoryLimitSessMinSize) diff --git a/store/driver/BUILD.bazel b/store/driver/BUILD.bazel index e3b0480f7e11d..d68f71cd44839 100644 --- a/store/driver/BUILD.bazel +++ b/store/driver/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//kv", + "//sessionctx/variable", "//store/copr", "//store/driver/error", "//store/driver/txn", @@ -19,6 +20,7 @@ go_library( "@com_github_tikv_client_go_v2//tikv", "@com_github_tikv_client_go_v2//tikvrpc", "@com_github_tikv_client_go_v2//util", + "@com_github_tikv_pd//pkg/mcs/resource_manager/client", "@com_github_tikv_pd_client//:client", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//keepalive", diff --git a/store/driver/tikv_driver.go b/store/driver/tikv_driver.go index 4519f693afb86..d6cb48a810119 100644 --- a/store/driver/tikv_driver.go +++ b/store/driver/tikv_driver.go @@ -92,7 +92,7 @@ func WithPDClientConfig(client config.PDClient) Option { } } -// TrySetupGlobalResourceController +// TrySetupGlobalResourceController tries to setup global resource controller. func TrySetupGlobalResourceController(ctx context.Context, serverID uint64, s kv.Storage) error { var store *tikvStore var ok = false