Making subscriptions persistent
When a subscription has been configured as persistent, the subscription will be restarted when the replication engine is restarted after shut down or after the subscription ends with a recoverable error.
About this task
- Interruptions in network communications.
- DB2® LUW deadlock or timeout errors for subscriptions that target Db2 LUW.
- Interruptions to database connections for Db2 for z/OSz/OS®.
- Connection failures due to SQLSTATE 57P01 or 08006 with CockroachDB target.
To automatically restart continuous mirroring of subscriptions after a normal shutdown of CDC Replication due to the preceding scenarios, you can mark the subscriptions as persistent.
When persistency is enabled and network communications terminate, CDC Replication attempts to automatically restart continuous mirroring for persistent subscriptions at regular intervals. Attempts continue until an automatic restart is successful or until the persistent subscription or the CDC Replication Engine for Db2® for z/OS address space is terminated.
In the event of a deadlock or timeout error with subscriptions that target Db2 LUW, an event message will indicate that the error is recoverable and if you mark the subscription as persistent it will restart automatically. When restarted, the subscription will resend the data that has been rolled back as a result of the error and continue.
Subscriptions will not restart automatically if you intentionally end replication for an active subscription by name. For CDC Replication Engine for Db2 for z/OS subscriptions only, automatic restart will still apply if you have ended replication for a group of subscriptions by specifying the wild card character ('*') with the ENDTSMIR command.
Persistency is only relevant to subscriptions that are used for continuous mirroring. If a persistent CDC Replication Engine for Db2 for z/OS subscription is used for Refresh or Scheduled End (Net Change) mirroring and network communications are interrupted, this subscription is restarted according to how the same subscription was terminated the last time it was used for continuous mirroring. For all other CDC Replication replication engines, if a persistent subscription is used for Refresh or Scheduled End (Net Change) mirroring and network communications are interrupted, it will not be restarted automatically.
CDC Replication Engine for PostgreSQL now includes improved automatic retry logic for handling connections failures with CockroachDB targets. It treats connection failures with SQLSTATE error codes 57P01 and 08006 as recoverable errors. When persistency is enabled and the connection is interrupted due to either of these error codes, CDC Replication automatically attempts to restart continuous mirroring for persistent subscriptions. This enhancement applies only when CockroachDB is used as the target database.
You can set how often CDC Replication Engine for Db2 for z/OS attempts to automatically restart continuous mirroring for persistent subscriptions by modifying the AUTORESTARTINTERVAL configuration control statement keyword. For more information, see your CDC Replication Engine for Db2 for z/OS documentation. For all other CDC Replication replication engines, you can set how often CDC Replication attempts to automatically restart continuous mirroring for persistent subscriptions by setting a non-zero value for the mirror_auto_restart_interval_seconds system parameter.
This functionality is not available in the following circumstances:
- Datastores for the CDC Replication Engine for Db2 for i