Skip to content

Commit

Permalink
Fix the issue that tiflash's data is not clean up (#768)
Browse files Browse the repository at this point in the history
We use ServicePort in DestroyClusterTombstone to construct id and filter by id,
but the id of instances of cluster is contract using Port(TCPPort for
	tiflash),
so it will not get the instance and clean it's data in DestroyClusterTombstone.

Note the GetMainPort() is TCPPort now, change the code to both
using GetMainPort() to avoid inconsistent.
  • Loading branch information
july2993 authored Sep 10, 2020
1 parent fb83c60 commit 7d25cbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/cluster/operation/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func DestroyClusterTombstone(
}

instances := (&spec.TiFlashComponent{Specification: cluster}).Instances()
id = s.Host + ":" + strconv.Itoa(s.GetMainPort())
instances = filterID(instances, id)

err = StopComponent(getter, instances, options.OptTimeout)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/tiflash.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (c *TiFlashComponent) Instances() []Instance {
InstanceSpec: s,
Name: c.Name(),
Host: s.Host,
Port: s.TCPPort,
Port: s.GetMainPort(),
SSHP: s.SSHPort,

Ports: []int{
Expand Down

0 comments on commit 7d25cbe

Please sign in to comment.