From ac62047808daa1baa6421c4ed587cece35c0c3a3 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Mon, 26 Jul 2021 06:29:37 +0000 Subject: [PATCH] Fix gaussdb mysql scaling up issue This takes BACKING UP status nodes into account when checking sclaing up operation. --- huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go b/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go index 5bb10c6716..3067b431a8 100644 --- a/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go +++ b/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go @@ -98,6 +98,7 @@ func resourceGaussDBInstance() *schema.Resource { }, "volume_size": { Type: schema.TypeInt, + Computed: true, Optional: true, }, "time_zone": { @@ -528,7 +529,7 @@ func resourceGaussDBInstanceRead(d *schema.ResourceData, meta interface{}) error volume_size = raw.Volume.Size } nodesList = append(nodesList, node) - if raw.Type == "slave" && raw.Status == "ACTIVE" { + if raw.Type == "slave" && (raw.Status == "ACTIVE" || raw.Status == "BACKING UP") { slave_count += 1 } if flavor == "" { @@ -704,7 +705,7 @@ func resourceGaussDBInstanceUpdate(d *schema.ResourceData, meta interface{}) err } slave_count := 0 for _, raw := range instance.Nodes { - if raw.Type == "slave" && raw.Status == "ACTIVE" { + if raw.Type == "slave" && (raw.Status == "ACTIVE" || raw.Status == "BACKING UP") { slave_count += 1 } }