Skip to content

Commit

Permalink
Merge 5db2cdb into c53895c
Browse files Browse the repository at this point in the history
  • Loading branch information
Smityz authored Dec 17, 2023
2 parents c53895c + 5db2cdb commit 3b0d877
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/cluster/manager/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ func buildScaleOutTask(
tb := task.NewSimpleUerSSH(m.logger, inst.GetManageHost(), inst.GetSSHPort(), base.User, gOpt, p, sshType).
Mkdir(base.User, inst.GetManageHost(), deployDirs...).
Mkdir(base.User, inst.GetManageHost(), dataDirs...).
Mkdir(base.User, inst.GetManageHost(), logDir)
Mkdir(base.User, inst.GetManageHost(), logDir).
Mkdir(base.User, inst.GetManageHost(), inst.ExtraDirs()...)

srcPath := ""
if patchedComponents.Exist(inst.ComponentName()) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/cluster/manager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ func (m *Manager) Deploy(

t := task.NewSimpleUerSSH(m.logger, inst.GetManageHost(), inst.GetSSHPort(), globalOptions.User, gOpt, sshProxyProps, globalOptions.SSHType).
Mkdir(globalOptions.User, inst.GetManageHost(), deployDirs...).
Mkdir(globalOptions.User, inst.GetManageHost(), dataDirs...)
Mkdir(globalOptions.User, inst.GetManageHost(), dataDirs...).
Mkdir(globalOptions.User, inst.GetManageHost(), inst.ExtraDirs()...)

if deployerInstance, ok := inst.(DeployerInstance); ok {
deployerInstance.Deploy(t, "", deployDir, version, name, clusterVersion)
Expand Down
5 changes: 5 additions & 0 deletions pkg/cluster/spec/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type Instance interface {
GetNumaNode() string
GetNumaCores() string
DeployDir() string
ExtraDirs() []string
UsedPorts() []int
UsedDirs() []string
Status(ctx context.Context, timeout time.Duration, tlsCfg *tls.Config, pdList ...string) string
Expand Down Expand Up @@ -393,6 +394,10 @@ func (i *BaseInstance) DeployDir() string {
return reflect.Indirect(reflect.ValueOf(i.InstanceSpec)).FieldByName("DeployDir").String()
}

func (i *BaseInstance) ExtraDirs() []string {
return nil
}

// TLSDir implements Instance interface
func (i *BaseInstance) TLSDir() string {
return i.DeployDir()
Expand Down
9 changes: 9 additions & 0 deletions pkg/cluster/spec/tikv.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,15 @@ func (i *TiKVInstance) PostRestart(ctx context.Context, topo Topology, tlsCfg *t
return nil
}

func (i *TiKVInstance) ExtraDirs() []string {
spec := i.InstanceSpec.(*TiKVSpec)
raftDir := spec.Config["raftstore.raftdb-path"]
if raftDir == nil {
return nil
}
return []string{raftDir.(string)}
}

func addr(spec *TiKVSpec) string {
if spec.AdvertiseAddr != "" {
return spec.AdvertiseAddr
Expand Down

0 comments on commit 3b0d877

Please sign in to comment.