-
Notifications
You must be signed in to change notification settings - Fork 62
💄 Surface better error when a publication is in an invalid state #1844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
💄 Surface better error when a publication is in an invalid state #1844
Conversation
addb683
to
57f6055
Compare
57f6055
to
8d5f6c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
|
||
This is a [known Postgres issue](https://www.postgresql.org/message-id/18683-a98f79c0673be358%40postgresql.org). | ||
|
||
**Fix**: drop and re-create the replication slot *after* the publication exists: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to prevent missing any changes, you should create a new slot, move Sequin to the new slot, then drop the old slot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RTLS The old slot will contain changes that the new slot will not when you create it :( so data loss feels certain. It's a big bummer, as dropping a publication feels non-deleterious, but it can be problematic.
Interestingly, by happenstance, it might work as when we connect to the new slot we might send back an old LSN first (cached) and possibly traverse backward - but this would be basically unsupported behavior. We might consider ways to make this operation "first class"
def to_existing_atom_safe(string) do | ||
String.to_existing_atom(string) | ||
rescue | ||
_ -> string | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this return a status tuple? I feel like this will lead to raises later due to an expected string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will change!
No description provided.