Skip to content

feat: use native PG17+ logical slot failover; retire spock worker on PG18#432

Merged
mason-sharp merged 1 commit intov5_STABLEfrom
feature/SPOC-74/pg17-native-slot-failover
Apr 26, 2026
Merged

feat: use native PG17+ logical slot failover; retire spock worker on PG18#432
mason-sharp merged 1 commit intov5_STABLEfrom
feature/SPOC-74/pg17-native-slot-failover

Conversation

@rasifr
Copy link
Copy Markdown
Member

@rasifr rasifr commented Apr 24, 2026

Backport of PR #409 (SPOC-74) from main, squashed into a single commit.

  • On PG17+, all logical replication slots are created with the FAILOVER
    flag, enabling PostgreSQL's built-in slotsync worker to synchronize
    them to physical standbys automatically.
  • On PG18+, spock_failover_slots background worker is not registered;
    the native slotsync worker fully replaces it.
  • On PG17, spock's worker remains active but yields (skips its sync
    loop) when sync_replication_slots = on is set, preventing conflicts.
  • Fix PG15/16 failover slot loss on promotion: reconnect with retry
    and guard against zero WAL flush LSN.
  • ZODAN: upgrade wait_for_sync_event calls to 5-arg form with timeout
    result checking; raise EXCEPTION on timeout/failure.
  • Add tests/tap/t/018_failover_slots.pl and schedule entry.
  • Add docs/logical_slot_failover.md and configuring.md section.

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb633ae7-2fed-4ae8-a9ff-c80e6ce1d003

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/SPOC-74/pg17-native-slot-failover

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 24, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 19 complexity · 0 duplication

Metric Results
Complexity 19
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

…PG18

Backport of PR #409 (SPOC-74) from main, squashed into a single commit.

- On PG17+, all logical replication slots are created with the FAILOVER
  flag, enabling PostgreSQL's built-in slotsync worker to synchronize
  them to physical standbys automatically.
- On PG18+, spock_failover_slots background worker is not registered;
  the native slotsync worker fully replaces it.
- On PG17, spock's worker remains active but yields (skips its sync
  loop) when sync_replication_slots = on is set, preventing conflicts.
- Fix PG15/16 failover slot loss on promotion: reconnect with retry
  and guard against zero WAL flush LSN.
- ZODAN: upgrade wait_for_sync_event calls to 5-arg form with timeout
  result checking; raise EXCEPTION on timeout/failure.
- Add tests/tap/t/018_failover_slots.pl and schedule entry.
- Add docs/logical_slot_failover.md and configuring.md section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rasifr rasifr force-pushed the feature/SPOC-74/pg17-native-slot-failover branch from 1e02249 to 88013e7 Compare April 24, 2026 17:18
@mason-sharp mason-sharp merged commit a23917e into v5_STABLE Apr 26, 2026
13 of 14 checks passed
@mason-sharp mason-sharp deleted the feature/SPOC-74/pg17-native-slot-failover branch April 26, 2026 00:40
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.

2 participants