Skip to content

fix sync of stream slots #2194

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

Merged
merged 1 commit into from
Jan 27, 2023
Merged

fix sync of stream slots #2194

merged 1 commit into from
Jan 27, 2023

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Jan 27, 2023

syncStatefulSet and syncStreams both call checkAndSetGlobalPostgreSQLConfiguration to compare desired and effective Patroni config. Usually desired is what's specified in the manifest.

syncStreams however uses the config patch code to create logical replication slots that are not specified in the manifest. These slots then get added to cluster.replicationSlots (only on UPDATE events changing streams). This variable was introduced in #2089 to detect the removal of slots from the manifest. It should only contain slots specified in the manifest.

On the next SYNC syncStatefulSet will only compare manifest with effective config. The Postgres Operator goes over cluster.replicationSlots which now contains slots created for streams, but will not find them in the manifest. Thus, they will be set to null and get removed.

SyncStreams will then recreate them a few seconds later and so on.

@FxKu FxKu added the bug label Jan 27, 2023
@FxKu FxKu added this to the 1.9 milestone Jan 27, 2023
@idanovinda
Copy link
Member

👍

1 similar comment
@FxKu
Copy link
Member Author

FxKu commented Jan 27, 2023

👍

@FxKu FxKu merged commit 7a90fbc into master Jan 27, 2023
@FxKu FxKu deleted the fix-slots-sync branch January 27, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants