Skip to content

Control how staged changes are pruned

The Capture Agent keeps every captured change in its staging database until SQDR has applied it. Pruning then deletes it, so the staging database doesn't keep growing. Most agents run well with the default settings. Change them, with the agent properties on this page, when you want to:

  • keep applied changes for a while, so you can replay them after a destination is restored from a backup, instead of running new baselines;
  • keep pruning out of busy hours;
  • find out why the staging database keeps growing although SQDR is applying the changes.

Set the properties on the agent's Configuration tab.

Keep changes for replay

The Data Replicator Manager's Replay makes incremental groups apply captured changes again from an earlier position, for example after a destination is restored from a backup (see Replay and Replay a member). It can only go back as far as the Capture Agent still holds the changes, and with the default pruneRetention of 0 they're gone as soon as they're applied. Set pruneRetention to the number of hours you want to be able to go back, and make sure the staging database has room for them.

Keep pruning out of busy hours

Set maintenanceWindow to the hours when pruning may run, for example 22:00-04:00. Make the window long enough for a whole day's backlog. When the backlog passes the storage monitor's throttle level, the agent prunes at once, even outside the window (see Storage monitor).

maintenanceWindow is the pruning window

maintenanceWindow only restricts pruning; capture goes on as usual. To pause capture while the source is maintained, use sourceMaintenanceWindow (see Pausing Stelo Capture during host maintenance).

When the staging database keeps growing

  • Check the pruning messages in the agent log: Pruning starting and, at the end of each cycle, Total rows pruned=..., Transactions pruned=..., Elapsed time=... with the tables pruned. The Statistics tab counts rows pruned, prune cycles and prune duration.
  • A change is pruned only once every subscription on its table has applied it: a subscription that isn't reading keeps its changes in the staging database.
  • See Reclaiming disk space in the staging database.

What is pruned, and when

  • What. For each staged table, the agent deletes the transactions that every subscription on that table has applied (with pruneRetention, only those committed more than that many hours ago). It also removes rolled-back transactions and staging tables no subscription uses any more: those only inside the maintenance window, or on every cycle when no window is set (a storage alert doesn't make it remove them).
  • When. The first cycle runs about a minute after the agent starts, then every pruneInterval minutes. During the first cycle capture is paused.
  • Taking a subscription offline empties its staging table at once (see Take subscriptions offline and online).

While a cycle runs, SQDR may briefly report errors fetching changes from the agent; they clear when the cycle ends.

Pruning properties

Property What it does Default When to change it
pruneInterval Minutes between pruning cycles. 30 Increase it when storage is plentiful and pruning competes with capture; decrease it when the staging database fills up between cycles.
pruneRetention Minimum hours a staged change is kept after it's committed, even once applied. 0 prunes changes as soon as every subscription has applied them. Changes can stay longer if a subscriber isn't reading. 0 Set it to how far back you want to be able to Replay (see above).
maintenanceWindow When pruning may run: comma-separated HH[:mm]-HH[:mm] ranges, 24-hour time, in the time zone of the agent's Java process. A range can cross midnight (22:00-04:00). An invalid value is logged as SEVERE at startup, and pruning then runs at any time. empty (any time) To keep pruning out of peak hours. Make the window long enough for a whole day's backlog.
maxPruneRows Rows deleted per batch. 20000 Only if directed by Stelo Support.
maxPruneTx Transactions deleted per batch. 20000 Only if directed by Stelo Support.
maxPruneThreads Threads that prune in parallel. 2 Only if directed by Stelo Support.
deepCleaning At startup, removes the records of staging tables that no longer exist, and does extra cleanup of each table in the first pruning cycle. false Only if directed by Stelo Support, for example after staging tables were dropped by hand.
pruneExclude An SQL condition added to the query that selects the transactions to prune. empty Only if directed by Stelo Support.
alwaysPruneChangeData No effect: kept so that existing configurations still load. true Never.