diff --git a/pkg/cluster/operation/destroy.go b/pkg/cluster/operation/destroy.go index 5fae6a1250..6ac89d3614 100644 --- a/pkg/cluster/operation/destroy.go +++ b/pkg/cluster/operation/destroy.go @@ -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 diff --git a/pkg/cluster/spec/tiflash.go b/pkg/cluster/spec/tiflash.go index c3d0113fe0..9caeeeb32f 100644 --- a/pkg/cluster/spec/tiflash.go +++ b/pkg/cluster/spec/tiflash.go @@ -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" )