feat(paradedb): expose replicationSlots on the CNPG Cluster#198
Open
philippemnoel wants to merge 3 commits into
Open
feat(paradedb): expose replicationSlots on the CNPG Cluster#198philippemnoel wants to merge 3 commits into
philippemnoel wants to merge 3 commits into
Conversation
Surfaces CNPG's replicationSlots field so chart users can enable synchronization of user-created logical replication slots between the primary and standbys. With PostgreSQL 17+ failover slots, this lets CDC consumers (e.g. Artie, Debezium) survive a CNPG failover without losing the slot. The block is omitted entirely when the value is empty, so existing deployments are unaffected.
Extends the existing non-default-configuration chainsaw test with a replicationSlots block (highAvailability + synchronizeReplicas) and asserts it appears verbatim on the rendered CNPG Cluster.
The pooler test's 20s assert timeout was too tight — the Deployment's status.readyReplicas occasionally hasn't been populated by kube-controller within that window, causing flaky failures unrelated to the chart change under test. Peer tests use 1m–3m (paradedb-enterprise: 2m, replica: 3m). Bump cleanup to 1m for consistency with the same peers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ticket(s) Closed
What
Exposes CloudNativePG's
.spec.replicationSlotsfield on the ParadeDB Cluster chart via a newcluster.replicationSlotsvalue.Why
CNPG does not synchronize user-created logical replication slots to standbys by default, so they only exist on the current primary. When CNPG fails over (manual, upgrade-driven, or otherwise), CDC consumers that depend on those slots — e.g. Artie, Debezium — lose their replication position and stop streaming until the slot is recreated, usually requiring a re-snapshot.
PostgreSQL 17+ supports failover slots (
sync_replication_slots = on,synchronized_standby_slots, slot-levelfailover = true). CNPG 1.22+ wires this up via.spec.replicationSlots.synchronizeReplicas, but the field was not surfaced by this chart, so chart users couldn't enable it without patching the rendered Cluster CR directly.A real customer (momogood, PG 18 + Artie -> Snowflake) hit this after a paradedb version bump: the rolling upgrade switched the primary, the logical slot didn't follow, and CDC stopped.
How
cluster.replicationSlotsblock invalues.yaml(default{}, with a commented-out example coveringhighAvailability,updateInterval, andsynchronizeReplicas).templates/cluster.yamlusing{{- with ... }}, so existing deployments that don't set the value are unaffected.Users opting in additionally need:
sync_replication_slots = onincluster.postgresql.parameters.failover = true.Tests
helm templatewith the value unset produces output identical tomain(noreplicationSlotskey on the Cluster CR).helm templatewithcluster.replicationSlots.highAvailability.enabled=trueandcluster.replicationSlots.synchronizeReplicas.enabled=trueproduces a valid Cluster CR with the expected block.failover = true, trigger a CNPG switchover, confirm the slot is present on the new primary at the correct LSN.