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

Perpetual diff with aws_dms_replication_task #19883

Closed
mattburgess opened this issue Jun 18, 2021 · 8 comments · Fixed by #30885
Closed

Perpetual diff with aws_dms_replication_task #19883

mattburgess opened this issue Jun 18, 2021 · 8 comments · Fixed by #30885
Labels
bug Addresses a defect in current functionality. service/dms Issues and PRs that pertain to the dms service.
Milestone

Comments

@mattburgess
Copy link
Collaborator

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.15.5
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.44.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Affected Resource(s)

  • aws_dms_replication_task

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_dms_replication_task" "test" {
  migration_type            = "full-load-and-cdc"
  replication_instance_arn  = aws_dms_replication_instance.test.replication_instance_arn
  replication_task_id       = "test"
  replication_task_settings = file("dms-task-settings.json")
  source_endpoint_arn       = aws_dms_endpoint.source.endpoint_arn
  target_endpoint_arn       = aws_dms_endpoint.target.endpoint_arn
  table_mappings            = file("dms-table-mappings.json")
}

The dms-task-settings.json is also pertinent; it's simply all of DMS' defaults, written with the intent of producing a zero-diff:

{
    "BeforeImageSettings": null,
    "ChangeProcessingDdlHandlingPolicy": {
        "HandleSourceTableAltered": true,
        "HandleSourceTableDropped": true,
        "HandleSourceTableTruncated": true
    },
    "ChangeProcessingTuning": {
        "BatchApplyMemoryLimit": 500,
        "BatchApplyPreserveTransaction": true,
        "BatchApplyTimeoutMax": 30,
        "BatchApplyTimeoutMin": 1,
        "BatchSplitSize": 0,
        "CommitTimeout": 1,
        "MemoryKeepTime": 60,
        "MemoryLimitTotal": 1024,
        "MinTransactionSize": 1000,
        "StatementCacheSize": 50
    },
    "CharacterSetSettings": null,
    "ControlTablesSettings": {
        "ControlSchema": "",
        "FullLoadExceptionTableEnabled": false,
        "HistoryTableEnabled": false,
        "HistoryTimeslotInMinutes": 5,
        "StatusTableEnabled": false,
        "SuspendedTablesTableEnabled": false
    },
    "ErrorBehavior": {
        "ApplyErrorDeletePolicy": "IGNORE_RECORD",
        "ApplyErrorEscalationCount": 0,
        "ApplyErrorEscalationPolicy": "LOG_ERROR",
        "ApplyErrorFailOnTruncationDdl": false,
        "ApplyErrorInsertPolicy": "LOG_ERROR",
        "ApplyErrorUpdatePolicy": "LOG_ERROR",
        "DataErrorEscalationCount": 0,
        "DataErrorEscalationPolicy": "SUSPEND_TABLE",
        "DataErrorPolicy": "LOG_ERROR",
        "DataTruncationErrorPolicy": "LOG_ERROR",
        "FailOnNoTablesCaptured": true,
        "FailOnTransactionConsistencyBreached": false,
        "FullLoadIgnoreConflicts": true,
        "RecoverableErrorCount": -1,
        "RecoverableErrorInterval": 5,
        "RecoverableErrorStopRetryAfterThrottlingMax": true,
        "RecoverableErrorThrottling": true,
        "RecoverableErrorThrottlingMax": 1800,
        "TableErrorEscalationCount": 0,
        "TableErrorEscalationPolicy": "STOP_TASK",
        "TableErrorPolicy": "SUSPEND_TABLE"
    },
    "FailTaskWhenCleanTaskResourceFailed": false,
    "FullLoadSettings": {
        "CommitRate": 10000,
        "CreatePkAfterFullLoad": false,
        "MaxFullLoadSubTasks": 8,
        "StopTaskCachedChangesApplied": false,
        "StopTaskCachedChangesNotApplied": false,
        "TargetTablePrepMode": "DROP_AND_CREATE",
        "TransactionConsistencyTimeout": 600
    },
    "Logging": {
        "EnableLogging": false,
        "LogComponents": [
            {
                "Id": "DATA_STRUCTURE",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "COMMUNICATION",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "IO",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "COMMON",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "FILE_FACTORY",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "FILE_TRANSFER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "REST_SERVER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "ADDONS",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TARGET_LOAD",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TARGET_APPLY",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "SOURCE_UNLOAD",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "SOURCE_CAPTURE",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TRANSFORMATION",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "SORTER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TASK_MANAGER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TABLES_MANAGER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "METADATA_MANAGER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "PERFORMANCE",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "VALIDATOR_EXT",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            }
        ]
    },
    "LoopbackPreventionSettings": null,
    "PostProcessingRules": null,
    "StreamBufferSettings": {
        "CtrlStreamBufferSizeInMB": 5,
        "StreamBufferCount": 3,
        "StreamBufferSizeInMB": 8
    },
    "TargetMetadata": {
        "BatchApplyEnabled": false,
        "FullLobMode": false,
        "InlineLobMaxSize": 0,
        "LimitedSizeLobMode": true,
        "LoadMaxFileSize": 0,
        "LobChunkSize": 64,
        "LobMaxSize": 32,
        "ParallelApplyBufferSize": 0,
        "ParallelApplyQueuesPerThread": 0,
        "ParallelApplyThreads": 0,
        "ParallelLoadBufferSize": 0,
        "ParallelLoadQueuesPerThread": 0,
        "ParallelLoadThreads": 0,
        "SupportLobs": true,
        "TargetSchema": "",
        "TaskRecoveryTableEnabled": false
    }
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Running terraform plan immediately after applying the above resource should show no diffs.

Actual Behavior

terraform plan shows diffs in the replication_task_settings.Logging.LogComponents:

  # aws_dms_replication_task.test will be updated in-place
  ~ resource "aws_dms_replication_task" "test" {
        id                        = "test"
      ~ replication_task_settings = jsonencode(
          ~ {
              ~ Logging                             = {
                  ~ LogComponents = [
                      ~ {
                          ~ Id       = "TRANSFORMATION" -> "DATA_STRUCTURE"
                            # (1 unchanged element hidden)
                        },
                      ~ {
                          ~ Id       = "SOURCE_UNLOAD" -> "COMMUNICATION"
                            # (1 unchanged element hidden)
                        },
                        {
                            Id       = "IO"
                            Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      + {
                          + Id       = "COMMON"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      + {
                          + Id       = "FILE_FACTORY"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      + {
                          + Id       = "FILE_TRANSFER"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      + {
                          + Id       = "REST_SERVER"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      + {
                          + Id       = "ADDONS"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                        {
                            Id       = "TARGET_LOAD"
                            Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      ~ {
                          ~ Id       = "PERFORMANCE" -> "TARGET_APPLY"
                            # (1 unchanged element hidden)
                        },
                      + {
                          + Id       = "SOURCE_UNLOAD"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                        {
                            Id       = "SOURCE_CAPTURE"
                            Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      + {
                          + Id       = "TRANSFORMATION"
                          + Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                        {
                            Id       = "SORTER"
                            Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      - {
                          - Id       = "REST_SERVER"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      - {
                          - Id       = "VALIDATOR_EXT"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      - {
                          - Id       = "TARGET_APPLY"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                        {
                            Id       = "TASK_MANAGER"
                            Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                        # (1 unchanged element hidden)
                        {
                            Id       = "METADATA_MANAGER"
                            Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      ~ {
                          ~ Id       = "FILE_FACTORY" -> "PERFORMANCE"
                            # (1 unchanged element hidden)
                        },
                      ~ {
                          ~ Id       = "COMMON" -> "VALIDATOR_EXT"
                            # (1 unchanged element hidden)
                        },
                      - {
                          - Id       = "ADDONS"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      - {
                          - Id       = "DATA_STRUCTURE"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      - {
                          - Id       = "COMMUNICATION"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                      - {
                          - Id       = "FILE_TRANSFER"
                          - Severity = "LOGGER_SEVERITY_DEFAULT"
                        },
                    ]
                    # (1 unchanged element hidden)
                }
                # (12 unchanged elements hidden)
            }
        )
        # (8 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. terraform apply
  2. terraform plan

Important Factoids

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/databasemigrationservice labels Jun 18, 2021
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 28, 2021
@jonassteinberg1
Copy link

hitting this as well

@antgel
Copy link

antgel commented Dec 1, 2021

This is probably somewhat related to #1513. I guess that #13476 was good at the time, but since then AWS have added more read-only settings. The workaround at #1513 (comment) is okay-ish (drop the quotes to avoid the deprecation warnings).

@oirtemed
Copy link

oirtemed commented Mar 2, 2022

Hitting a similar issue with version v4.3.0. It seems that #23328 didn't fix it

In my case, the change in the plan shows changes on TTSettings for all the replication tasks. example:

   # aws_dms_replication_task.user_cdc will be updated in-place
   ~ resource "aws_dms_replication_task" "user_cdc" {
         id                        = "user-cdc"
       ~ replication_task_settings = jsonencode(
           ~ {
               - TTSettings                          = {
                   - EnableTT         = false
                   - TTRecordSettings = null
                   - TTS3Settings     = null
                 } -> null
                 # (13 unchanged elements hidden)
             }
         )
         tags                      = {}
         # (9 unchanged attributes hidden)
     }

@ewbankkit ewbankkit added the service/dms Issues and PRs that pertain to the dms service. label Jun 2, 2022
@jeremychauvet
Copy link
Contributor

jeremychauvet commented Aug 25, 2022

Facing the same issue:

  # module.xxx.aws_dms_replication_task.this will be updated in-place
  ~ resource "aws_dms_replication_task" "this" {
      - cdc_start_position        = "2022-08-25T10:10:00" -> null
        id                        = "..."
      ~ replication_task_settings = jsonencode(
          ~ {
              - BeforeImageSettings                 = null -> null
              - CharacterSetSettings                = null -> null
              ~ ControlTablesSettings               = {
                  - FullLoadExceptionTableEnabled = false -> null
                  + historyTimeslotInMinutes      = 5
                    # (5 unchanged elements hidden)
                }
              ~ ErrorBehavior                       = {
                  - EventErrorPolicy                            = "IGNORE" -> null
                  - RecoverableErrorStopRetryAfterThrottlingMax = true -> null
                    # (20 unchanged elements hidden)
                }
              - FailTaskWhenCleanTaskResourceFailed = false -> null

Terraform: 1.2.9
Provider: hashicorp/aws v4.29.0

@tylerbillgo
Copy link

tylerbillgo commented Mar 2, 2023

Also running into this with the most recent AWS provider as of today. We've had this running for months without anything coming up and then today it just decided this was needed.

id :  "name-goes-here-prod"
~ replication_task_settings :   jsonencode({
      ~ Logging : {
         + EnableLogContext : false
       }
})

Terraform: 1.3.4
Provider: hashicorp/aws v4.56.0

@github-actions
Copy link

This functionality has been released in v4.65.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. Thank you!

@nvx
Copy link

nvx commented May 10, 2023

I'm running into this on the latest v4.66.1. The diff shows the LogComponents as needing a change due to re-ordering of the array which matches the original issue.

The PR's that were meant to fix this look like they target other fields for some reason?

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/dms Issues and PRs that pertain to the dms service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants