---
title: "Contributing to Debezium: Fixing Logical Replication at Scale"
description: "Zalando contributed two configuration options to Debezium's PostgreSQL connector, released in 3.4.0.Final."
url: "https://swe.quest/articles/contributing-to-debezium-fixing-logical-replication-at-scale-9a91b621ec2af98e"
canonical: "https://engineering.zalando.com/posts/2025/12/contributing-to-debezium.html"
source: "Zalando Engineering"
published: "2025-12-18"
difficulty: "hard"
kind: "Case study"
reading_minutes: 9
tags: ["postgres","event-driven","replication","open-source","data-pipelines"]
---

# Contributing to Debezium: Fixing Logical Replication at Scale

A post on [Zalando Engineering](https://swe.quest/sources/zalando.md), published 2025-12-18, 9 min read, Case study. Original: [https://engineering.zalando.com/posts/2025/12/contributing-to-debezium.html](https://engineering.zalando.com/posts/2025/12/contributing-to-debezium.html)

## Summary

Zalando contributed two configuration options to Debezium's PostgreSQL connector, released in 3.4.0.Final. They restore the pgjdbc keepalive flush that prevents runaway WAL growth on low-activity databases and resolve the offset/slot LSN mismatch that made it unsafe with durable offset stores. The first option, \`lsn.flush.mode\` (manual, connector, connector\_and\_driver), lets the JDBC driver advance the replication slot past unmonitored WAL activity. The second, \`offset.mismatch.strategy\` (no\_validation, trust\_offset, trust\_slot, trust\_greater\_lsn), controls whether Debezium trusts the stored offset or the slot on startup, both with backward-compatible mapping from the deprecated booleans. The recommended setup is connector\_and\_driver with trust\_greater\_lsn for persistent offset stores, which avoids dummy heartbeat writes and full re-syncs.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)

## Prerequisites

- PostgreSQL logical replication ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- replication slots and WAL ([easy posts on Replication](https://swe.quest/tags/replication.md?difficulty=easy))
- Debezium CDC ([easy posts on Event-driven architecture](https://swe.quest/tags/event-driven.md?difficulty=easy))
- Kafka Connect offsets ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))

## Keywords

Debezium, PostgreSQL, pgjdbc, Fabric Event Streams, Patroni, Kafka Connect, pg\_replication\_slot\_advance

## Related posts

- [Patching the PostgreSQL JDBC Driver](https://swe.quest/articles/patching-the-postgresql-jdbc-driver-47e9400eaa77f0d2.md): Zalando Engineering · 2023-11-08 · Medium · 10 min read · PostgreSQL, Replication, Event-driven architecture, Java & JVM, Open source
  Postgres logical replication slots for clients watching low-traffic tables never advance, so the server retains all WAL generated by other tables until disk fills and the node goes read-only.
- [Fan-out from Postgres with Change Data Capture using Debezium and Upstash Redis](https://swe.quest/articles/fan-out-from-postgres-with-change-data-capture-using-debezium-and-upstash-redis-1afcb52ed56a9566.md): Neon · 2024-02-14 · Medium · 9 min read · Event-driven architecture, PostgreSQL, Queues & messaging, Replication
  Streaming committed Postgres changes from the write-ahead log via a logical replication slot avoids the dual-write problem, where an application writes to the database and a message broker separately and can leave them inconsistent.
- [Event-driven architectures using Neon and Sequin](https://swe.quest/articles/event-driven-architectures-using-neon-and-sequin-8e1877ce94623987.md): Neon · 2024-10-22 · Medium · 5 min read · Event-driven architecture, PostgreSQL, Replication
  Sequin offers a lighter alternative to Debezium plus Kafka for change data capture on Neon Postgres, using a logical replication slot to build a strictly ordered "Sequence" of table rows that consumers can read, rewind and replay without copying data into a separate system.
- [A Guide to Logical Replication and CDC in PostgreSQL with Airbyte](https://swe.quest/articles/a-guide-to-logical-replication-and-cdc-in-postgresql-with-airbyte-4e37edf2ac1b986b.md): Neon · 2024-01-11 · Medium · 9 min read · PostgreSQL, Replication, Event-driven architecture, Data pipelines
  PostgreSQL logical replication builds on the write-ahead log: logical decoding turns byte-level WAL records into row-level INSERT/UPDATE/DELETE changes, and replication slots track each subscriber's LSN while retaining WAL until it is consumed.
- [Blocking cutovers to save replication slots](https://swe.quest/articles/blocking-cutovers-to-save-replication-slots-d52d9d5fcc4a6789.md): PlanetScale · 2026-09-21 · Medium · 5 min read · PostgreSQL, Replication, Event-driven architecture, Deployment
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
