Skip to content

Commit

Permalink
Fix gaussdb mysql scaling up issue (#1310)
Browse files Browse the repository at this point in the history
This takes BACKING UP status nodes into account when checking
sclaing up operation.
  • Loading branch information
niuzhenguo authored Jul 26, 2021
1 parent 440f16c commit 6fb8d44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func resourceGaussDBInstance() *schema.Resource {
},
"volume_size": {
Type: schema.TypeInt,
Computed: true,
Optional: true,
},
"time_zone": {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 6fb8d44

Please sign in to comment.