Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 3 min read Announcement mediumAdept

ClickPipes for Postgres now supports failover replication slots

Postgres ClickPipes can now create logical replication slots with failover enabled, so CDC pipelines into ClickHouse survive a primary-to-standby promotion. The feature depends on Postgres 17 logical replication failover. Both primary and standby must run Postgres 17+, with the standby using a physical replication slot and synchronous commit configured. hot_standby_feedback and sync_replication_slots must be enabled on the standby, and the standby's physical slot must be added to synchronized_standby_slots on the primary so the standby never lags the ClickPipe. You can confirm it works by checking pg_replication_slots on the standby for a mirror_ slot with synced and failover set to true.

Related posts

  • Blocking cutovers to save replication slots

    PlanetScale mediumAdept

    PlanetScale Postgres blocks planned cutovers (resizes, parameter changes, maintenance) when logical replication slots aren't synchronized to the replica being promoted, because vanilla Postgres will promote a replica without the slot and silently break CDC consumers. To make slots promotion-ready, create them with failover = true (or ALTER_REPLICATION_SLOT ... (FAILOVER true)) and set hot_standby_feedback and sync_replication_slots to on. The operator detects misconfiguration, alerts users, waits for slots to be ready, and manages synchronized_standby_slots. Enabling hot_standby_feedback pins the primary's vacuum horizon and can add bloat, which is why both settings are off by default.

  • Building an enterprise Postgres service in ClickHouse Cloud

    ClickHouse easyNovice

    ClickHouse Cloud's managed Postgres runs on NVMe with up to two cross-AZ synchronous standbys using quorum commit (acknowledged when one standby confirms) and automatic failover. Standbys are deliberately kept off read traffic so WAL replay lag and VACUUM interference don't delay failover; separate read replicas handle read scaling. Other features include failover-safe logical replication slots that keep ClickPipes/PeerDB CDC into ClickHouse running across failovers without full resyncs, WAL-G daemon-based continuous archiving for 7-day PITR and forks, and per-cluster dedicated VPCs with TLS, AES-256 at rest and Private Link. Planned work includes GCP support, near-sub-second CDC v2, Query Performance Insights and Terraform support.

  • Postgres CDC in ClickHouse, A year in review

    ClickHouse mediumAdept

    A year after PeerDB's acquisition, Postgres CDC into ClickHouse via ClickPipes has grown to 400+ companies replicating over 200 TB per month, driven by real-time customer-facing analytics and data warehousing workloads. Key engineering changes include keeping logical replication connections open, because reconnects re-read WAL from restart_lsn and spiked lag. CTID block-based partitioning cut initial-load partition generation from 7+ hours to under a second, and 50+ pre-flight checks plus bucketed user-facing alerts cut on-call load by orders of magnitude. The biggest remaining gap is data modeling overhead from ReplacingMergeTree's asynchronous deduplication, which ClickHouse plans to address with lightweight UPDATEs and unique indexes.

  • Postgres at Open House NYC

    ClickHouse easyNovice

    ClickHouse used its Open House NYC keynote to launch WalShadow, an open-source engine that replicates Postgres into ClickHouse from the physical WAL instead of logical replication. It decodes WAL outside the source and uses a schema-only shadow Postgres to track DDL, effectively making ClickHouse an analytical physical standby. On 8-vCPU instances it showed about 200 ms commit-to-visible latency and 300K rows/s, versus about 10 s and 120K rows/s for PeerDB. The keynote also opened a Google Cloud private preview of ClickHouse Managed Postgres and released a chdb Postgres extension that extends COPY to import from S3, GCS and Azure and outperformed DuckDB-based extensions on the NYC Taxi import benchmark.

  • Designing a planned switchover for minimum disruption

    PlanetScale hardMaster

    Neki performs planned Postgres primary switchovers without stopping the old primary. Routers buffer primary-bound queries, the primary is set read-only by default, and every replica except the target is disconnected so its receive_lsn fixes a final WAL position the target must replay through. Preflight checks cover shard state, failover slots and capacity settings such as max_connections, and post-convergence checks cover slots and having at least one synchronous standby attached. If any check fails before promotion, a config reload makes the old primary writable again for a fast rollback. With ANY 1 synchronous replication and synchronous_commit=on, every acknowledged commit is present on the target when it is promoted.

The quest for software engineering knowledge.

Look:
Layout: