Skip to content

Commit

Permalink
final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
djshow832 committed Aug 13, 2024
1 parent 33a3e54 commit 3e3a227
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
13 changes: 0 additions & 13 deletions pkg/cluster/manager/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ func buildScaleOutTask(
base := metadata.GetBaseMeta()
specManager := m.specManager

m.logger.Infof("topo %v\n mergedTopo %v\n newPart %v\n",
topo.(*spec.Specification).ComponentVersions,
mergedTopo.(*spec.Specification).ComponentVersions,
newPart.(*spec.Specification).ComponentVersions)

tlsCfg, err := topo.TLSConfig(m.specManager.Path(name, spec.TLSCertKeyDir))
if err != nil {
return nil, err
Expand All @@ -122,14 +117,6 @@ func buildScaleOutTask(
})
// uninitializedHosts are hosts which haven't been initialized yet
uninitializedHosts := make(map[string]hostInfo) // host -> ssh-port, os, arch

// When iterating over the newPart, the original component_versions is not passed in.
// Copy the merged component_versions to newPart.
if newSpec, ok := newPart.(*spec.Specification); ok {
if mergedSpec, ok := mergedTopo.(*spec.Specification); ok {
newSpec.ComponentVersions = mergedSpec.ComponentVersions
}
}
newPart.IterInstance(func(instance spec.Instance) {
host := instance.GetManageHost()
if initializedHosts.Exist(host) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/cluster/manager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ func (m *Manager) Deploy(
return err
}

m.logger.Infof("topology, %v", topo.(*spec.Specification).ComponentVersions)

if err := checkTiFlashWithTLS(topo, clusterVersion); err != nil {
return err
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/cluster/manager/scale_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ func (m *Manager) ScaleOut(
}
}
}

// newPart needs ComponentVersions but the original ComponentVersions is not passed to newPart.
// Copy the merged ComponentVersions to newPart.
if newSpec, ok := newPart.(*spec.Specification); ok {
newSpec.ComponentVersions = topo.ComponentVersions
}
}

if err := checkConflict(m, name, mergedTopo); err != nil {
Expand Down
7 changes: 3 additions & 4 deletions pkg/cluster/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,9 @@ type UpgradableMetadata interface {
// NewPart implements ScaleOutTopology interface.
func (s *Specification) NewPart() Topology {
return &Specification{
GlobalOptions: s.GlobalOptions,
MonitoredOptions: s.MonitoredOptions,
ServerConfigs: s.ServerConfigs,
ComponentVersions: s.ComponentVersions,
GlobalOptions: s.GlobalOptions,
MonitoredOptions: s.MonitoredOptions,
ServerConfigs: s.ServerConfigs,
}
}

Expand Down

0 comments on commit 3e3a227

Please sign in to comment.