Skip to content

fix(cdc): preserve polling retries through slot preparation - #2451

Open
hsusul wants to merge 2 commits into
supabase:mainfrom
hsusul:fix/poller-preserve-retry-streak
Open

hsusul wants to merge 2 commits into
supabase:mainfrom
hsusul:fix/poller-preserve-retry-streak

Conversation

@hsusul

@hsusul hsusul commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Why

Repeated Postgres Changes polling failures never reach the existing recovery thresholds because successful slot preparation resets their retry count and backoff. An existing slot can prepare successfully while another backend still holds it.

Fixes #2450.

What changed

  • Preserve the failure count and backoff through preparation. The existing successful-poll branch resets them after recovery.
  • Add regressions for persistent polling failure, increasing retry delays, and active-slot recovery.

Scope

This restores the existing retry and backend-termination thresholds. Publication-empty transitions, database queries, and public APIs retain their existing behavior.

Blast Radius

Postgres Changes pollers can now terminate a stuck slot holder or shut down after persistent errors as originally intended. Successful polling still clears the failure streak.

Verification

  • Focused regressions fail on upstream and pass with the fix. Restoring either premature reset independently also fails a regression.
  • mix test test/extensions/postgres_cdc_rls passes with 12 doctests, 235 tests, and 6 Docker or synchronous-standby cases excluded. A real PostgreSQL probe confirms preparation succeeds while polling the same active slot fails.
  • Warnings-as-errors compilation, format, strict Credo, unused dependencies, Sobelow, Dialyzer, and git diff --check pass locally. Elixir 1.19.5, OTP 28.5.0.8, PostgreSQL 17.11. The full application suite and Docker CI matrix were not run locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReplicationPoller never reaches recovery thresholds after repeated polling failures

1 participant