Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiup cluster prune need to delete storage.remote.cache.dir #2142

Merged
merged 3 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
}
}
hehechen marked this conversation as resolved.
Show resolved Hide resolved

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