Skip to content

Conversation

@FxKu
Copy link
Member

@FxKu FxKu commented Oct 24, 2025

On UPDATE events the secrets sync can exit early on error but the database role sync will still happen. This will potentially override database passwords with what was generated in the initUsers step. Environment variables don't get overridden and Patroni can still operate, but apps (and even the operator when it happens to postgres user) will get "locked out".

We could decide to not call syncRoles if the secret sync fails. We already do so if the initUsers step fails. During cluster creation and sync any error in SyncSecrets stops the entire sync loop as well. Only during update we care to process resources as much as possible.

Therefore, I chose a more fine-grained approach and still try to sync roles when the secret sync worked for them. I've added a new field in the pgUser struct to remember if the user is degraded or not. This logic will also be applied for cluster CREATE and SYNC events, meaning no database user would get created if the secret creation failed.

@FxKu FxKu added the bugfix label Oct 24, 2025
@FxKu FxKu added this to the 1.15.1 milestone Oct 24, 2025
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