Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch committed Jan 20, 2023
1 parent 909e9ce commit 6885ebd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
4 changes: 2 additions & 2 deletions domain/globalconfigsync/globalconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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
}
err := s.pd.StoreGlobalConfig(ctx, GlobalConfigPath, []pd.GlobalConfigItem{item})
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
}

Expand Down
1 change: 1 addition & 0 deletions sessionctx/variable/sysvar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions store/driver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//kv",
"//sessionctx/variable",
"//store/copr",
"//store/driver/error",
"//store/driver/txn",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion store/driver/tikv_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6885ebd

Please sign in to comment.