stream: slot and FES should not be created if the publication creation fails #2704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses two related issues regarding the stream section during publication and slot creation:
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.
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 Enable slot and publication deletion when stream application is removed #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.