Pipeline failure due to replica queries being canceled

Last updated on Feb 19, 2024
Applies To PostgreSQL Source (all variants) Pipelines with Logical Replication mode.
Error Message Text(s) - FATAL: terminating connection due to conflict with recovery.
- ERROR: canceling statement due to conflict with recovery.

Error Summary

When you use a PostgreSQL replica server as your Source, there may be instances where the queries used by Hevo to ingest data fail due to errors such as Replica Canceled Query or Failed to Pipe Output from Query.

Potential Cause(s)

  • The replica server canceled the execution of Hevo’s queries after the maximum allowed delay had elapsed. This is done to synchronize the Write-Ahead Log (WAL) of the replica server with that of the primary server.

Suggested Action(s)

  • To avoid cancelation of the data ingestion queries, increase the maximum allowed delay to an appropriate value based on your requirements. For this, in the postgresql.conf file of your replica server:

    • If your replica server reads WAL data from an archive on the primary server, add the parameter max_standby_archive_delay with an appropriate value.

    • If your replica server reads WAL data using streaming from the primary server, add the parameter max_standby_streaming_delay with an appropriate value.

    Refer to the section, Set up Log-based Incremental Replication of your PostgreSQL variant for the steps to change the postgresql.conf file.

  • Specify the max_standby_archive_delay and max_standby_streaming_delay parameters with a proper time unit, such as seconds or minutes. The default value for these parameters is 30 seconds.

    Note: If a time unit is not specified, the parameter value is taken as milliseconds.



Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Feb-19-2024 NA New document.

Tell us what went wrong