Skip to content

Reliability

How to set up groups so that errors, maintenance and long baselines don't cost you data or days.

Let polling errors retry, and get notified

Do: keep Error Retry Limit at 0 and set up email notifications for errors (see Notification and Severity Levels).

Why: most polling errors are temporary (the Capture Agent restarting, a network drop, the destination being backed up). With 0, the group retries about every minute and becomes active again by itself, without a new baseline. With a limit, the group pauses itself after that many consecutive errors and stays paused until someone resumes it or the Replicator Service restarts; meanwhile changes accumulate at the Capture Agent.

A lost connection doesn't lose changes either way. The Capture Agent retries its source connection until it succeeds, and then continues reading the log from its last checkpoint, the last change it knows it captured. The Replicator Service applies changes to the destination in transactions, so after a lost connection it retries the connection and continues from the last commit. No one needs to restart anything.

Not when: a group should stop rather than keep trying, for example so that someone investigates first. Then set a limit and make sure paused groups are noticed.

Detect lost connections quickly with TCP keepalive

Do: on the Stelo VM (and on the Stelo VM, if SQDR runs on its own server), keep Windows' TCP keepalive short, so that a connection to a source or destination, or between the Stelo VM, that drops silently is detected within about a minute. The values are in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters:

Value (REG_DWORD) What it is Value set by the SQDR installer
KeepAliveTime How long (ms) a connection stays idle before TCP checks that the other side is still there. Windows' default is 2 hours. 60000
KeepAliveInterval How long (ms) TCP waits between checks when one goes unanswered. 1000
TcpMaxDataRetransmissions How many times TCP retransmits a packet before it gives up on the connection. 30

The SQDR installer sets these values when it first installs SQDR. To check them, or to set them again (for example when a policy has removed them), run in PowerShell as an administrator, then restart the server so that they take effect:

$key = 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
# Show the current values (empty when not set)
Get-ItemProperty $key | Select-Object KeepAliveTime, KeepAliveInterval, TcpMaxDataRetransmissions
# Set them
New-ItemProperty -Path $key -Name KeepAliveTime -Value 60000 -PropertyType DWord -Force
New-ItemProperty -Path $key -Name KeepAliveInterval -Value 1000 -PropertyType DWord -Force
New-ItemProperty -Path $key -Name TcpMaxDataRetransmissions -Value 30 -PropertyType DWord -Force

Why: a connection can break without either side being told, for example when a firewall or router drops an idle connection. Until TCP notices, the Capture Agent or the Replicator Service waits on a connection that no longer works, and replication stalls without an error. With short keepalive times, the broken connection fails quickly, and the connection is retried (see above).

Keep in mind: these are settings of the whole server, so they affect every program on it.

Docker

The Stelo Replicator container's compose file already sets short keepalive times for the container (sysctls; see .env settings).

Keep Automatic Snapshot on, except for large tables

Do: keep Automatic Snapshot on for most groups. Turn it off for groups with very large tables, and baseline them with Run or a group Schedule at a quiet time.

Why: with Automatic Snapshot, a member that needs a baseline (new, reset, altered on a source without ALTER processing, or changed) gets one within minutes, unattended. But the baseline starts whenever it's needed, possibly at peak time, and one that keeps failing is retried about every 6 minutes, each time emptying the destination table first (Truncate or Delete). A group schedule doesn't stop Automatic Snapshot: to decide when baselines run, turn it off.

Use checkpoint/restart for long baselines

Do: keep Allow Checkpoint/Restart on (the default) for groups with large tables, with non-zero commit intervals.

Why: an interrupted baseline then continues from its last commit instead of copying the whole table again (see Checkpoint/Restart). A restart needs a primary key (or the RRN on Db2 for i) and a destination that still holds exactly the committed rows (not, for example, after a restore); otherwise the baseline starts over. Saving a member or changing the setting clears the checkpoints.

Choose Error Recovery for snapshot groups by dependency

Do: keep Ignore Errors and Warnings when members are independent, and choose Halt on Errors only when later members depend on earlier ones (for example members whose processing SQL builds on tables copied before). See How a group run works.

Why: with Ignore, one failing member doesn't stop the others from being refreshed, and every failure is still recorded. Halting prevents later members from being built on incomplete data.

Don't schedule two runs of the same thing

Do: schedule a snapshot subscription either on its own or through its group, not both, and leave enough time between occurrences for a run to finish.

Why: a scheduled run of a group or subscription that's still running is skipped (with a "... is busy" error), and a group skips a member running elsewhere. Scheduled runs don't queue up. See How scheduled runs behave.

Pause before maintenance

Do: before maintenance of the destination database, pause the groups that write to it; before maintenance of the source database or the Capture Agent, pause the source (which pauses all its groups). Resume afterwards. For a restore or migration of a source database, follow Move or replace a source (for a restore, A restored source) and, for Db2 for i sources, Pausing for host maintenance.

Why: while a group is paused, changes keep being captured and staged, and are applied after you resume: nothing is lost and no baseline is needed. Without a pause, the group runs into errors during the maintenance, and changes applied to a destination that's then restored from an older backup are lost.

Keep in mind: Resume on the source restarts every incremental group of the source, including groups you had paused on purpose. Keep the pause short: the staging database grows meanwhile (see staging).

Save group properties when you can resume right away

Do: change an incremental group's properties when a short pause is acceptable, and click Resume as soon as you've saved (see Saving changes).

Why: saving an incremental group pauses it until it's resumed. Changes to Force hidden column, Default Derived Columns and Subscription Wizard Defaults affect only new members; changing Allow Checkpoint/Restart clears the members' checkpoints.

Keep staged data for replay if you may need it

Do: if you may need to re-apply changes after the destination is restored from a backup, set the Capture Agent's pruneRetention to the number of hours you want to be able to go back (see Control how staged changes are pruned), and use subscriptions that tolerate re-applied changes, such as Allow UPSERT. Pause the group before you replay.

Why: Replay repositions the group at the Capture Agent and applies the changes again from that point (see Replay a member and source Replay). By default the Capture Agent prunes staged changes as soon as they're applied, so there's nothing to replay. With Strict Apply Rules, re-applied inserts of rows already there are flagged.

Not when: keeping hours of changes would make the staging database too large; then recover with a new baseline.