Skip to content
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

sync stateful set when syncing streams during ADD event #2245

Merged
merged 1 commit into from Feb 28, 2023

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Feb 27, 2023

In #2187 the flow for configuring Postgres for streams was moved to syncStatefulSet, because it's the only place right now where we restart Postgres on config changes. The restart is required to set wal_level to logical before creating publications and replication slots.

However, syncStatefulSet is not executed during Create. Whem a new cluster is added with stream section we face the same error as before - creation of publication during syncStreams will fail because wal_level has not been adjusted, yet. It happens only during next SYNC when it's too late.

Therefore, this PR proposed to call syncStatefulSet inside Create method, if streams are defined.

In case the sync of statefulset will fail return an error. I moved setting replicationSlots before the syncing of streams to have it set even when there is this error.

@FxKu FxKu added this to the 1.9.1 milestone Feb 27, 2023
@FxKu
Copy link
Member Author

FxKu commented Feb 28, 2023

👍

1 similar comment
@idanovinda
Copy link
Member

👍

@FxKu FxKu merged commit 9973262 into master Feb 28, 2023
@FxKu FxKu deleted the cluster-create-w-streams branch February 28, 2023 08:14
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.

None yet

2 participants