Skip to content

Commit

Permalink
Del paths if needs.
Browse files Browse the repository at this point in the history
Signed-off-by: lucasliang <[email protected]>
  • Loading branch information
LykxSassinator committed Dec 3, 2024
1 parent 7cc079f commit e768deb
Showing 1 changed file with 9 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 @@ -382,6 +382,15 @@ func DestroyComponent(ctx context.Context, instances []spec.Instance, cls spec.T
}
}

// For TiKV, we need to delete all extra data directories if the data is not retained.
if ins.ComponentName() == spec.ComponentTiKV {
for _, dir := range ins.UsedDirs() {
if !dataRetained {
delPaths.Insert(dir)
}
}
}

// For TiFlash, we need to delete storage.remote.cache.dir
if ins.ComponentName() == spec.ComponentTiFlash {
tiflashInstance := ins.(*spec.TiFlashInstance)
Expand Down

0 comments on commit e768deb

Please sign in to comment.