9

错误:

2019-06-17T05:00:11 [SOURCE_CAPTURE ]E: RetCode: SQL_ERROR SqlState: 58P01 NativeError: 1 Message: ERROR: could not access file "pglogical": No such file or directory;, Error while executing the query [1022502] (ar_odbc_stmt.c:2546)
2019-06-17T05:00:11 [SOURCE_CAPTURE ]E: RetCode: SQL_ERROR SqlState: 42P01 NativeError: 1 Message: ERROR: relation "pglogical.replication_set" does not exist;, No query has been executed with that handle [1022502] (ar_odbc_stmt.c:3722)

我们每 3 个月左右收到一次此错误。重新启动任务解决了问题,但恢复不起作用。

复制槽存在,但似乎处于非活动状态:

   postgres=> select * from pg_replication_slots ;
                               slot_name                            |    plugin     | slot_type | datoid |   database    | active | active_pid | xmin | catalog_xmin | restart_lsn
    ----------------------------------------------------------------+---------------+-----------+--------+---------------+--------+------------+------+--------------+--------------
     juvmrynv47ajpwrc_00016389_f28d6802_db75_43d6_8058_315783e9b1b2 | test_decoding | logical   |  16389 | postgres | f      |            |      |    148271120 | 8DF/B292FB48
    (1 row)
4

3 回答 3

2

在我们的例子中,活动事务导致了这个失败。因此,当 DMS 任务在失败后恢复或手动恢复时,它将尝试创建一个不需要源数据库上的活动事务的虚拟复制槽,默认情况下,DMS 将等待 10 分钟以完成活动事务,然后任务将失败,并显示如下错误。

2019-09-02T06:48:10 [SOURCE_CAPTURE  ]E:  RetCode: SQL_ERROR  SqlState: 57014 NativeError: 1 Message: ERROR: canceling statement due to statement timeout;
Error while executing the query [1022502]  (ar_odbc_stmt.c:2581)

解决方案-

  • 将任务设置TransactionConsistencyTimeout从 600 秒增加到 1800 秒。
  • 检查您的复制实例是否消耗过多内存。
  • 在您的任务设置中启用调试模式并获取有关失败的更多详细信息 -

    "LogComponents": [
      {
        "Id": "SOURCE_UNLOAD",
        "Severity": "LOGGER_SEVERITY_DETAILED_DEBUG"
      },
      {
        "Id": "SOURCE_CAPTURE",
        "Severity": "LOGGER_SEVERITY_DETAILED_DEBUG"
      },
      {
        "Id": "TARGET_LOAD",
        "Severity": "LOGGER_SEVERITY_DETAILED_DEBUG"
      },
      {
        "Id": "TARGET_APPLY",
        "Severity": "LOGGER_SEVERITY_DETAILED_DEBUG"
      },
      {
        "Id": "TASK_MANAGER",
        "Severity": "LOGGER_SEVERITY_DETAILED_DEBUG"
      }
    ]
    
于 2019-12-12T13:17:57.110 回答
2

我面临着与 OP 描述的相同的错误。对我来说,我正在运行的环境是: - 使用 DMS 版本 3.1.4 - 使用目标和源作为 Postgresql Aurora 10.7

后来在检查有关在https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html上设置此文档的文档时,发现实际上对于 Postgres 版本 > 10,我必须使用 DMS 3.3.0 版以后。

更改版本使其实际工作,因此请确保在来这里之前检查亚马逊的文件:)

于 2020-01-02T04:28:53.157 回答
0

通过更新 rds.logical_replication 设置,我能够找到解决此问题的方法。执行此操作的步骤在这里 -使用 AWS DMS 将数据从 RDS Postgres(只读副本)复制到 Redshift 时出现复制槽错误

于 2021-12-01T14:38:19.607 回答