From db84a523dcc0a62c9168f40f93239b3da99d0d89 Mon Sep 17 00:00:00 2001 From: liguohao <48315319+GehaFearless@users.noreply.github.com> Date: Mon, 19 Dec 2022 11:37:05 +0800 Subject: [PATCH] fix: fix judgment to disk for partition split (#1293) --- admin-cli/executor/partition_split.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-cli/executor/partition_split.go b/admin-cli/executor/partition_split.go index 10bab4d964..87505add92 100644 --- a/admin-cli/executor/partition_split.go +++ b/admin-cli/executor/partition_split.go @@ -153,7 +153,7 @@ func DiskBeforeSplit(client *Client, tableName string) error { for _, rCapacity := range nodeDiskStats.ReplicaCapacity { totalSize += rCapacity.Size } - diskUsedAfterSplit := totalSize*3 + nodeDiskStats.DiskAvailable + diskUsedAfterSplit := totalSize*3 + nodeDiskStats.DiskCapacity - nodeDiskStats.DiskAvailable diskThreshold := nodeDiskStats.DiskCapacity * 9 / 10 if diskUsedAfterSplit > diskThreshold { return fmt.Errorf("disk(%s@%s) doesn't have enough space to execute partition split[after(%v) vs capacity(%v)]", nodeDiskStats.NodeAddress, nodeDiskStats.DiskTag, diskUsedAfterSplit, diskThreshold)