-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource/aws_elasticsearch_domain: Ensure in-place version upgrade is fully successful before returning #11793
Conversation
… fully successful before returning Previously in the acceptance testing: ``` --- FAIL: TestAccAWSElasticSearchDomain_update_version (901.47s) testing.go:640: Step 2 error: Check failed: Check 3/3 error: aws_elasticsearch_domain.test: Attribute 'elasticsearch_version' expected "5.6", got "5.5" ``` The AWS Elasticsearch service upgrade process uses the same response object with multiple step values ([Elasticsearch User Guide](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-version-migration.html) or more clearly, the [AWS CLI documentation](https://docs.aws.amazon.com/cli/latest/reference/es/get-upgrade-status.html)). The previous logic had race condition for when the actual upgrade step was the one that was completed, e.g. ``` 2020/01/28 21:47:05 [DEBUG] [aws-sdk-go] DEBUG: Response es/GetUpgradeStatus Details: ... 2020/01/28 21:47:05 [DEBUG] [aws-sdk-go] {"StepStatus":"SUCCEEDED","UpgradeName":"Upgrade from 5.5 to 5.6","UpgradeStep":"SNAPSHOT"} ``` During the actual upgrade, the `UpgradeStep` is named `UPGRADE`: ``` 2020/01/29 08:30:07 [DEBUG] [aws-sdk-go] {"StepStatus":"IN_PROGRESS","UpgradeName":"Upgrade from 5.5 to 5.6","UpgradeStep":"UPGRADE"} ``` We will now only consider upgrade status refresh function `StepStatus` of `SUCCEEDED` only on the `UpgradeStep` value of `UPGRADE`. Output from acceptance testing: ``` --- PASS: TestAccAWSElasticSearchDomain_basic (2441.12s) --- PASS: TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig (5287.37s) --- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove (1881.56s) --- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsUpdate (2385.75s) --- PASS: TestAccAWSElasticSearchDomain_complex (1040.02s) --- PASS: TestAccAWSElasticSearchDomain_duplicate (403.91s) --- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key (760.05s) --- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key (909.73s) --- PASS: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (2496.06s) --- PASS: TestAccAWSElasticSearchDomain_LogPublishingOptions (1598.99s) --- PASS: TestAccAWSElasticSearchDomain_NodeToNodeEncryption (1015.12s) --- PASS: TestAccAWSElasticSearchDomain_policy (1832.67s) --- PASS: TestAccAWSElasticSearchDomain_RequireHTTPS (2784.03s) --- PASS: TestAccAWSElasticSearchDomain_tags (752.75s) --- PASS: TestAccAWSElasticSearchDomain_update (1862.46s) --- PASS: TestAccAWSElasticSearchDomain_update_version (3422.13s) --- PASS: TestAccAWSElasticSearchDomain_update_volume_type (3397.51s) --- PASS: TestAccAWSElasticSearchDomain_v23 (1323.39s) --- PASS: TestAccAWSElasticSearchDomain_vpc (1045.76s) --- PASS: TestAccAWSElasticSearchDomain_vpc_update (2579.22s) --- PASS: TestAccAWSElasticSearchDomain_withDedicatedMaster (2644.34s) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
--- PASS: TestAccAWSElasticSearchDomain_duplicate (623.65s)
--- PASS: TestAccAWSElasticSearchDomain_tags (665.40s)
--- PASS: TestAccAWSElasticSearchDomain_NodeToNodeEncryption (825.46s)
--- PASS: TestAccAWSElasticSearchDomain_LogPublishingOptions (833.19s)
--- PASS: TestAccAWSElasticSearchDomain_policy (886.70s)
--- PASS: TestAccAWSElasticSearchDomain_basic (949.95s)
--- PASS: TestAccAWSElasticSearchDomainPolicy_basic (1106.33s)
--- PASS: TestAccAWSElasticSearchDomain_vpc (1229.65s)
--- PASS: TestAccAWSElasticSearchDomain_complex (1296.40s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key (1318.91s)
--- PASS: TestAccAWSElasticSearchDomain_v23 (1331.82s)
--- PASS: TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key (1421.12s)
--- PASS: TestAccAWSElasticSearchDomain_internetToVpcEndpoint (1786.48s)
--- PASS: TestAccAWSElasticSearchDomain_vpc_update (1961.17s)
--- PASS: TestAccAWSElasticSearchDomain_RequireHTTPS (2151.44s)
--- PASS: TestAccAWSElasticSearchDomain_update (2310.27s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove (2334.12s)
--- PASS: TestAccAWSElasticSearchDomain_CognitoOptionsUpdate (2697.49s)
--- PASS: TestAccAWSElasticSearchDomain_update_volume_type (3145.16s)
--- PASS: TestAccAWSElasticSearchDomain_update_version (3218.29s)
--- PASS: TestAccAWSElasticSearchDomain_withDedicatedMaster (4030.70s)
--- PASS: TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig (4984.66s)
This has been released in version 2.47.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Release note for CHANGELOG:
Previously in the acceptance testing:
The AWS Elasticsearch service upgrade process uses the same response object with multiple step values (Elasticsearch User Guide or more clearly, the AWS CLI documentation). The previous logic had race condition for when the actual upgrade step was the one that was completed, e.g.
During the actual upgrade, the
UpgradeStep
is namedUPGRADE
:We will now only consider upgrade status refresh function
StepStatus
ofSUCCEEDED
only on theUpgradeStep
value ofUPGRADE
.Output from acceptance testing: