Skip to content

Commit

Permalink
fix: fix judgment to disk for partition split (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
GehaFearless authored Dec 19, 2022
1 parent 95470ee commit db84a52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin-cli/executor/partition_split.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit db84a52

Please sign in to comment.