Connect

 View Only

Connect CDC backlog and why rp_trans changes system behavior

  • 1.  Connect CDC backlog and why rp_trans changes system behavior

    Employee
    Posted 16 hours ago
    I ran into a case where replication looked healthy at first glance, but data at the target kept getting delayed. The issue was not capture. It was backlog building in the queue. What stood out was this - backlog does not just delay replication, it changes how the system behaves.

    How the pipeline works
    Connect CDC processes data in stages:

    Capture → rp_trans → Preparer → Apply
    Every committed transaction lands in rp_trans first before anything is applied to the target.
    When things are running well
    • rp_trans stays small
    • Retriever keeps pulling transactions continuously
    • Apply keeps up with incoming data
    • Latency remains low
    The system behaves like a real-time stream.

    What changes when backlog builds
    1. The queue becomes the bottleneck
    • Transactions start piling up in rp_trans
    • Incoming rate is higher than processing rate
    2. Apply becomes the choke point
    • ApplyDispatcher starts holding packets
    • Applier signals “pipe full”
    • Upstream stages slow down automatically
    This is built-in backpressure. The system protects itself by slowing down.
    3. Latency increases without failure
    • Data is still captured
    • Data is still in the queue
    • But it reaches the target much later
    From the outside, everything looks “running”. But consumers see delayed data.
    The important insight
    Backlog pushes CDC out of streaming mode and into buffering mode.
    • Retriever slows down
    • Preparer accumulates work
    • Apply dominates overall performance
    At that point, the queue is no longer just a buffer. It becomes the center of control for the entire pipeline.

    Why it matters in production
    If backlog keeps growing:
    • rp_trans size increases
    • Disk usage grows
    • Restart and recovery become heavier
    • Catch-up time gets longer as the gap increases
    The longer it runs like this, the harder it is to recover real-time behavior.
    How to read the signals
    If I see:
    • “pipe full” messages
    • steady growth in rp_trans
    • increasing latency
    I treat it as an apply throughput problem, not a capture issue.

    Takeaway
    rp_trans is not just a queue. It is the point where CDC either stays real-time or quietly falls behind.
    Understanding that shift made it much easier for me to troubleshoot delays and focus on the right part of the pipeline.

    Have you seen cases where CDC looked healthy but the target was still behind?


    ------------------------------
    Adhitya Maya
    *Precisely Software Inc.
    ------------------------------