zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 980 forks source link

stream: slot and FES should not be created if the publication creation fails #2704

Closed idanovinda closed 3 months ago

idanovinda commented 3 months ago

This pull request addresses two related issues regarding the stream section during publication and slot creation:

  1. Conditional FES Resource Creation: The FES (Fabric Event Stream) resource will no longer be created if the logical slot does not exist. Previously, there was a bug causing the FES resource to be created regardless of the existence of the logical slot. This was not the expected behavior because creating the FES resource would trigger the FES operator to create publications and slots if they were missing. If publication and slot creation were not possible (e.g., due to missing tables), it would result in failures.

  2. Logical Slot Creation/Deletion Based on Publication Modification: The logical slot will now only be created or deleted if the publication modification is successful. Following the changes in #2684, a logical slot was being created regardless of whether the publication creation was successful. This change ensures that logical slot creation is consistent with the success of publication modification, preventing potential issues related to dangling slots that accumulate WAL (Write-Ahead Logging) entries, which could result in risk to the cluster.

FxKu commented 3 months ago

:+1:

idanovinda commented 3 months ago

👍