Skip to content

chore: recreate stale rsources subscription on shared db - #7108

Merged
atzoum merged 1 commit into
masterfrom
chore.rsourcesDeletedReplSlot
Jun 24, 2026
Merged

atzoum merged 1 commit into
masterfrom
chore.rsourcesDeletedReplSlot

Conversation

@atzoum

@atzoum atzoum commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

When rsources logical replication is set up, the shared (subscriber) database holds a subscription per instance, while the local (publisher) database holds the matching replication slot. Today, if that slot disappears — most notably when the local db's persistent volume is deleted and the db is recreated from scratch — the subscription on the shared db survives but is permanently broken: CREATE SUBSCRIPTION only ever returns DuplicateObject and is skipped, so the slot is never recreated and replication stays silently dead.

This PR makes setup self-healing. Before creating the subscription, we now detect a stale subscription (one whose replication slot no longer exists on the publisher) and drop it so it can be recreated together with a fresh slot. The drop uses DISABLE → SET (slot_name = NONE) → DROP so it doesn't try to contact the publisher for the missing slot.

Also truncates the subscription name to Postgres' 63-byte identifier limit so the catalog lookup matches what the server actually stored (long pod hostnames could otherwise bypass the detection).

Linear Ticket

resolves PIPE-3134

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov

codecov Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.69697% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.85%. Comparing base (e0a2e42) to head (94a01a9).

Files with missing lines Patch % Lines
services/rsources/handler.go 69.69% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7108      +/-   ##
==========================================
+ Coverage   79.48%   79.85%   +0.36%     
==========================================
  Files         583      583              
  Lines       65362    65394      +32     
==========================================
+ Hits        51956    52222     +266     
+ Misses      10315    10064     -251     
- Partials     3091     3108      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atzoum
atzoum force-pushed the chore.rsourcesDeletedReplSlot branch from d9987f5 to 8436fae Compare June 22, 2026 10:53
@atzoum
atzoum force-pushed the chore.rsourcesDeletedReplSlot branch from 8436fae to 89bcaa9 Compare June 22, 2026 14:19
@atzoum
atzoum force-pushed the chore.rsourcesDeletedReplSlot branch from 89bcaa9 to 94a01a9 Compare June 22, 2026 14:53

@mihir20 mihir20 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@atzoum
atzoum merged commit c59e9e5 into master Jun 24, 2026
74 checks passed
@atzoum
atzoum deleted the chore.rsourcesDeletedReplSlot branch June 24, 2026 03:37
This was referenced Jun 29, 2026
atzoum pushed a commit that referenced this pull request Jun 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.79.0-rc.1](v1.78.0...v1.79.0-rc.1)
(2026-06-29)


### Features

* support compressing payloads in reporting client
([#7124](#7124))
([365b530](365b530))
* support deltalake azure hierarchical namespace folders
([#7089](#7089))
([61b41e4](61b41e4))


### Bug Fixes

* panic in user transformer client due to timeout doesn't get recorded
by alerts
([#7116](#7116))
([61b41e4](61b41e4))
* partition migration restarts server on slow in-progress wait
([#7129](#7129))
([d63d597](d63d597))


### Miscellaneous

* **jobsdb:** capturing multi-consumer pending events
([#7121](#7121))
([dc382f7](dc382f7))
* **jobsdb:** cleanup legacy configuration flags
([#7122](#7122))
([58778d5](58778d5))
* **jobsdb:** multi-consumer compaction
([#7096](#7096))
([57f1ef5](57f1ef5))
* **jobsdb:** multi-consumer get and noresults cache handling
([#7095](#7095))
([9d5c58a](9d5c58a))
* **jobsdb:** multi-consumer get distinct consumers
([#7097](#7097))
([f68a56d](f68a56d))
* **jobsdb:** multi-consumer partition migration
([#7098](#7098))
([9cda68d](9cda68d))
* **jobsdb:** multi-consumer-specific indexes and views
([#7093](#7093))
([61b41e4](61b41e4))
* **jobsdb:** multiconsumer flip, registry table and unionjobsdb
([#7094](#7094))
([9eff2e9](9eff2e9))
* **jobsdb:** new columns for multi-consumer jobsdb
([#7082](#7082))
([61b41e4](61b41e4))
* recreate stale rsources subscription on shared db
([#7108](#7108))
([c59e9e5](c59e9e5))
* use priority pool at migration start while polling for pending jobs
([#7128](#7128))
([254ae15](254ae15))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This was referenced Jun 29, 2026
atzoum pushed a commit that referenced this pull request Jun 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.79.0-rc.2](v1.78.0...v1.79.0-rc.2)
(2026-06-29)


### Features

* support compressing payloads in reporting client
([#7124](#7124))
([365b530](365b530))
* support deltalake azure hierarchical namespace folders
([#7089](#7089))
([61b41e4](61b41e4))


### Bug Fixes

* **jobsdb:** compaction panics with pq error column js.consumer does
not exist at position
([#7133](#7133))
([f392a53](f392a53))
* panic in user transformer client due to timeout doesn't get recorded
by alerts
([#7116](#7116))
([61b41e4](61b41e4))
* partition migration restarts server on slow in-progress wait
([#7129](#7129))
([d63d597](d63d597))


### Miscellaneous

* **jobsdb:** capturing multi-consumer pending events
([#7121](#7121))
([dc382f7](dc382f7))
* **jobsdb:** cleanup legacy configuration flags
([#7122](#7122))
([58778d5](58778d5))
* **jobsdb:** multi-consumer compaction
([#7096](#7096))
([57f1ef5](57f1ef5))
* **jobsdb:** multi-consumer get and noresults cache handling
([#7095](#7095))
([9d5c58a](9d5c58a))
* **jobsdb:** multi-consumer get distinct consumers
([#7097](#7097))
([f68a56d](f68a56d))
* **jobsdb:** multi-consumer partition migration
([#7098](#7098))
([9cda68d](9cda68d))
* **jobsdb:** multi-consumer-specific indexes and views
([#7093](#7093))
([61b41e4](61b41e4))
* **jobsdb:** multiconsumer flip, registry table and unionjobsdb
([#7094](#7094))
([9eff2e9](9eff2e9))
* **jobsdb:** new columns for multi-consumer jobsdb
([#7082](#7082))
([61b41e4](61b41e4))
* recreate stale rsources subscription on shared db
([#7108](#7108))
([c59e9e5](c59e9e5))
* use priority pool at migration start while polling for pending jobs
([#7128](#7128))
([254ae15](254ae15))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
atzoum pushed a commit that referenced this pull request Jun 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.79.0](v1.78.0...v1.79.0)
(2026-06-29)


### Features

* support compressing payloads in reporting client
([#7124](#7124))
([365b530](365b530))
* support deltalake azure hierarchical namespace folders
([#7089](#7089))
([61b41e4](61b41e4))


### Bug Fixes

* **jobsdb:** compaction panics with pq error column js.consumer does
not exist at position
([#7133](#7133))
([f392a53](f392a53))
* panic in user transformer client due to timeout doesn't get recorded
by alerts
([#7116](#7116))
([61b41e4](61b41e4))
* partition migration restarts server on slow in-progress wait
([#7129](#7129))
([d63d597](d63d597))


### Miscellaneous

* **jobsdb:** capturing multi-consumer pending events
([#7121](#7121))
([dc382f7](dc382f7))
* **jobsdb:** cleanup legacy configuration flags
([#7122](#7122))
([58778d5](58778d5))
* **jobsdb:** multi-consumer compaction
([#7096](#7096))
([57f1ef5](57f1ef5))
* **jobsdb:** multi-consumer get and noresults cache handling
([#7095](#7095))
([9d5c58a](9d5c58a))
* **jobsdb:** multi-consumer get distinct consumers
([#7097](#7097))
([f68a56d](f68a56d))
* **jobsdb:** multi-consumer partition migration
([#7098](#7098))
([9cda68d](9cda68d))
* **jobsdb:** multi-consumer-specific indexes and views
([#7093](#7093))
([61b41e4](61b41e4))
* **jobsdb:** multiconsumer flip, registry table and unionjobsdb
([#7094](#7094))
([9eff2e9](9eff2e9))
* **jobsdb:** new columns for multi-consumer jobsdb
([#7082](#7082))
([61b41e4](61b41e4))
* recreate stale rsources subscription on shared db
([#7108](#7108))
([c59e9e5](c59e9e5))
* use priority pool at migration start while polling for pending jobs
([#7128](#7128))
([254ae15](254ae15))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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.

3 participants