From 941c8a18afb61f1cd1af73d829368aca5817bc8a Mon Sep 17 00:00:00 2001 From: Xinye Tao Date: Mon, 5 Jul 2021 20:30:12 +0800 Subject: [PATCH 1/6] Fix TiKV config check false alarm --- pkg/cluster/spec/server_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/spec/server_config.go b/pkg/cluster/spec/server_config.go index 92ed98c305..b792dc67d9 100644 --- a/pkg/cluster/spec/server_config.go +++ b/pkg/cluster/spec/server_config.go @@ -300,7 +300,7 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, clusterVer if componentName == ComponentTiKV { extra = `--pd=""` } - cmd = fmt.Sprintf("%s --config-check --config=%s %s", binPath, configPath, extra) + cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir %s %s", binPath, paths.Data, dataPath, extra) } _, _, err := e.Execute(ctx, cmd, false) From 6f2d64791db5d66eb074488c840d49b000ef4cff Mon Sep 17 00:00:00 2001 From: Xinye Tao Date: Mon, 5 Jul 2021 20:33:42 +0800 Subject: [PATCH 2/6] minor fix --- pkg/cluster/spec/server_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/spec/server_config.go b/pkg/cluster/spec/server_config.go index b792dc67d9..689bcb826b 100644 --- a/pkg/cluster/spec/server_config.go +++ b/pkg/cluster/spec/server_config.go @@ -300,7 +300,7 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, clusterVer if componentName == ComponentTiKV { extra = `--pd=""` } - cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir %s %s", binPath, paths.Data, dataPath, extra) + cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir %s %s", binPath, binPath, paths.Data, extra) } _, _, err := e.Execute(ctx, cmd, false) From 1f033d53f43be7701a51a491fa7e6dab4282cbfb Mon Sep 17 00:00:00 2001 From: Xinye Tao Date: Mon, 5 Jul 2021 20:34:34 +0800 Subject: [PATCH 3/6] Fix param passing --- pkg/cluster/spec/server_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/spec/server_config.go b/pkg/cluster/spec/server_config.go index 689bcb826b..a413e827d7 100644 --- a/pkg/cluster/spec/server_config.go +++ b/pkg/cluster/spec/server_config.go @@ -300,7 +300,7 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, clusterVer if componentName == ComponentTiKV { extra = `--pd=""` } - cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir %s %s", binPath, binPath, paths.Data, extra) + cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir=%s %s", binPath, binPath, paths.Data, extra) } _, _, err := e.Execute(ctx, cmd, false) From 50809747b3233f087a12361339745f1c21c8b983 Mon Sep 17 00:00:00 2001 From: Xinye Tao Date: Mon, 5 Jul 2021 20:38:36 +0800 Subject: [PATCH 4/6] minor fix --- pkg/cluster/spec/server_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/spec/server_config.go b/pkg/cluster/spec/server_config.go index a413e827d7..9c1664f6b3 100644 --- a/pkg/cluster/spec/server_config.go +++ b/pkg/cluster/spec/server_config.go @@ -300,7 +300,7 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, clusterVer if componentName == ComponentTiKV { extra = `--pd=""` } - cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir=%s %s", binPath, binPath, paths.Data, extra) + cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir=%s %s", binPath, configPath, paths.Data, extra) } _, _, err := e.Execute(ctx, cmd, false) From 6e3809384526dc1d94288b2a96038b0b268f5dd0 Mon Sep 17 00:00:00 2001 From: Xinye Tao Date: Tue, 6 Jul 2021 00:02:17 +0800 Subject: [PATCH 5/6] Address comment --- pkg/cluster/spec/server_config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/spec/server_config.go b/pkg/cluster/spec/server_config.go index 9c1664f6b3..da22722c1e 100644 --- a/pkg/cluster/spec/server_config.go +++ b/pkg/cluster/spec/server_config.go @@ -295,12 +295,12 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, clusterVer return nil } - // Hack tikv --pd flag extra := "" if componentName == ComponentTiKV { - extra = `--pd=""` + // Pass in an empty pd address and the correct data dir + extra = fmt.Sprintf(`--pd="" --data-dir="%s"`, paths.Data[0]) } - cmd = fmt.Sprintf("%s --config-check --config=%s --data-dir=%s %s", binPath, configPath, paths.Data, extra) + cmd = fmt.Sprintf("%s --config-check --config=%s %s", binPath, configPath, extra) } _, _, err := e.Execute(ctx, cmd, false) From 4c90e946c583993f0dfbe86dc8bb53fea458a969 Mon Sep 17 00:00:00 2001 From: Xinye Tao Date: Tue, 6 Jul 2021 00:05:03 +0800 Subject: [PATCH 6/6] Consistent with normal run --- pkg/cluster/spec/server_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/spec/server_config.go b/pkg/cluster/spec/server_config.go index da22722c1e..fc468c711a 100644 --- a/pkg/cluster/spec/server_config.go +++ b/pkg/cluster/spec/server_config.go @@ -298,7 +298,7 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, clusterVer extra := "" if componentName == ComponentTiKV { // Pass in an empty pd address and the correct data dir - extra = fmt.Sprintf(`--pd="" --data-dir="%s"`, paths.Data[0]) + extra = fmt.Sprintf(`--pd "" --data-dir "%s"`, paths.Data[0]) } cmd = fmt.Sprintf("%s --config-check --config=%s %s", binPath, configPath, extra) }