Skip to content

Commit ff3f264

Browse files
cluster: support tikv-worker
1 parent 184f09f commit ff3f264

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

pkg/cluster/spec/server_config.go

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -261,31 +261,19 @@ func checkConfig(ctx context.Context, e ctxt.Executor, componentName, componentS
261261
version = utils.NightlyVersionAlias
262262
}
263263

264-
// For some repos (e.g. internal ones), tikv-worker can be packaged as an
265-
// extra binary inside the `tikv` component. Prefer checking with
266-
// `bin/tikv-worker` when it exists, otherwise fall back to the component's
267-
// default entry.
268-
var binPath string
269-
if componentName == ComponentTiKVWorker {
270-
candidate := path.Join(paths.Deploy, "bin", ComponentTiKVWorker)
271-
if _, _, err := e.Execute(ctx, "test -x "+candidate, false); err == nil {
272-
binPath = candidate
273-
}
274-
} else {
275-
entry, err := repo.ComponentBinEntry(componentSource, version)
276-
if err != nil {
277-
return perrs.Annotate(ErrorCheckConfig, err.Error())
278-
}
279-
binPath = path.Join(paths.Deploy, "bin", entry)
264+
entry, err := repo.ComponentBinEntry(componentSource, version)
265+
if err != nil {
266+
return perrs.Annotate(ErrorCheckConfig, err.Error())
280267
}
268+
binPath := path.Join(paths.Deploy, "bin", entry)
281269

282270
// Skip old versions
283271
if !hasConfigCheckFlag(ctx, e, binPath) {
284272
return nil
285273
}
286274

287275
extra := ""
288-
if componentName == ComponentTiKV || componentName == ComponentTiKVWorker {
276+
if componentName == ComponentTiKV {
289277
// Pass in an empty pd address and the correct data dir
290278
extra = fmt.Sprintf(`--pd "" --data-dir "%s"`, paths.Data[0])
291279
}

0 commit comments

Comments
 (0)