Skip to content
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

Merged
merged 1 commit into from
Jan 30, 2020

Commits on Jan 29, 2020

  1. resource/aws_elasticsearch_domain: Ensure in-place version upgrade is…

    … 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)
    ```
    bflad committed Jan 29, 2020
    Configuration menu
    Copy the full SHA
    02afcf5 View commit details
    Browse the repository at this point in the history