fix: Reconcile on SubscriptionManager init#1931
Merged
Merged
Conversation
leandrocp
approved these changes
Jun 8, 2026
edgurgel
force-pushed
the
fix/subscription-manager-reconciliation
branch
from
June 16, 2026 04:57
9e73b55 to
bf522a5
Compare
Instead of always deleting the subscriptions table when SubscriptionManager starts we: * warm restarts now re-adopt ETS and re-monitor subscribers * cold start cleans up the DB Orphan processes are not a problem because ReplicationPoller simply broadcasts if it can't find the pid related to the subscription row
edgurgel
force-pushed
the
fix/subscription-manager-reconciliation
branch
from
June 16, 2026 04:58
bf522a5 to
67dc693
Compare
|
🎉 This PR is included in version 2.107.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Instead of always deleting the subscriptions table when
SubscriptionManagerstarts we:Orphan processes are not a problem because
ReplicationPollersimply broadcasts if it can't find the pid/node related to the subscription row. Seerealtime/lib/extensions/postgres_cdc_rls/replication_poller.ex
Lines 251 to 273 in ca0a9bc
One option that I decided to not implement was to do a "delete from subscription NOT IN $alive_sub_ids" as this can be problematic depending on the size of the table and it's not a huge issue to have orphan rows there momentarily. It's also more complicated.