elastic / terraform-provider-ec

https://registry.terraform.io/providers/elastic/ec/latest/docs
Apache License 2.0
175 stars 88 forks source link

Removing the Coordinator Node from ec_deployment resource does not award back the ingest node role to hot nodes if zone count is not set to zero. #697

Open shermanericts opened 1 year ago

shermanericts commented 1 year ago
13:35 $ terraform --version
Terraform v1.3.9
+ provider registry.terraform.io/elastic/ec v0.8.0
+ provider registry.terraform.io/elastic/elasticstack v0.7.0

I just realized I still have the zone count at 2, so i'll set that to zero first and report back if it's still an issue.

Readiness Checklist

Expected Behavior

When removing the coordinating node, the Ingest node role should be applied back to the hot nodes.

Current Behavior

When removing the coordinating node, the Ingest node role is not applied

 Terraform definition

coordinating = {
      autoscaling   = {}
      size          = "0g"
      size_resource = "memory"
      zone_count    = 2
    }

Steps to Reproduce

  1. See Above

Context

I need to currently use the UI to remove a coordinating node.

Possible Solution

When removing the coordinating nodes, make sure the ingest node.role is applied back to the hot nodes.

Your Environment

shermanericts commented 1 year ago

Note: If I put the zone count at zero, the plan applies and the ingest node role gets awarded back to the hot node. However, I go through a fail cycle of this which I know is in other tickets. Additionally, I had to do one Deployment Restart in the Elastic Console UI for this to take effect.

╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.customer_env.module.elastic.ec_deployment.customer, provider
│ "provider[\"registry.terraform.io/elastic/ec\"]" produced an unexpected new value:
│ .elasticsearch.coordinating.zone_count: was cty.NumberIntVal(0), but now cty.NumberIntVal(2).
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

When I put the zone count to 1, then the plan applies fine.

I'm happy to have this ticket closed if it's expected behavior - but leaving open in case this is net new.