# Kafka's log compaction corrupts data. Here's how we fixed it

DevFeed: [Kafka's log compaction corrupts data. Here's how we fixed it](<https://devfeed.tech/articles/kafka-s-log-compaction-corrupts-data-here-s-how-we-fixed-it-12713.md>)

Original publisher: [Read original article](<https://www.redpanda.com/blog/kafka-log-compaction-bug-fix-streaming>)

Author: Alexey Bashtanov

Published: 2026-06-25T00:00:00Z

Content type: article

Language: en

Sources: [Redpanda](<https://devfeed.tech/sources/redpanda.md>)

Topics: [Kafka](<https://devfeed.tech/topics/kafka.md>), [Apache-Kafka](<https://devfeed.tech/topics/apache-kafka.md>), [bug](<https://devfeed.tech/topics/bug.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [apache-kafka](<https://devfeed.tech/tags/apache-kafka.md>), [bug](<https://devfeed.tech/tags/bug.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

The article examines a bug in Apache Kafka log compaction that can cause replicas to permanently disagree about retained records. It describes how tombstones and transaction control batches may be removed independently on different brokers, allowing deleted data to reappear or aborted data to be served as committed, and presents coordinated compaction in Redpanda Streaming as the solution.

## Source excerpt

There's a problem with Apache Kafka's log compaction. Here's what we found, how to reproduce it, and how we solved it in Redpanda.