Skip to content

Commit

Permalink
tiup cluster prune need to delete storage.remote.cache.dir (#2142)
Browse files Browse the repository at this point in the history
  • Loading branch information
hehechen authored Mar 21, 2023
1 parent d8e9242 commit 05db4f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cluster/operation/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,15 @@ func DestroyComponent(ctx context.Context, instances []spec.Instance, cls spec.T
}
}

// For TiFlash, we need to delete storage.remote.cache.dir
if ins.ComponentName() == spec.ComponentTiFlash {
tiflashInstance := ins.(*spec.TiFlashInstance)
tiflashSpec := tiflashInstance.InstanceSpec.(*spec.TiFlashSpec)
if remoteCacheDir, ok := tiflashSpec.Config[spec.TiFlashRemoteCacheDir]; ok {
delPaths.Insert(remoteCacheDir.(string))
}
}

logDir := ins.LogDir()

// In TiDB-Ansible, deploy dir are shared by all components on the same
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/tiflash.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const (
TiFlashStorageKeyMainDirs string = "storage.main.dir"
TiFlashStorageKeyLatestDirs string = "storage.latest.dir"
TiFlashStorageKeyRaftDirs string = "storage.raft.dir"
TiFlashRemoteCacheDir string = "storage.remote.cache.dir"
TiFlashRequiredCPUFlags string = "avx2 popcnt movbe"
)

Expand Down

0 comments on commit 05db4f1

Please sign in to comment.