Hi Andrew,

Thanks, that helps a lot. Makes sense that active vs inactive segments
would be totally different problems I hadn't thought through how
much harder it'd be to touch a segment that's still being written to.

Given how expensive it'd be to rewrite even an inactive segment just
to remove one record, it sounds like physical deletion probably isn't
the right direction to push on.

I'd actually be more interested in hearing about the GDPR tricks you
mentioned - crypto-shredding or whatever people have used to make a
record unreadable without touching the log itself. That seems like a
much more realistic path, since it doesn't mess with replication or
log immutability at all.

If anyone else on the list has done this or has pointers, I'd love to
hear more. Happy to help explore whether this is something worth
writing up as a KIP if there's enough interest.

Thanks,
Sri

On Mon, 20 Jul 2026 at 13:29, Andrew Schofield <[email protected]>
wrote:

> Hi,
> Unfortunately not. Your summary of the various ways in which records are
> deleted is spot on.
>
> If you want to knock out a specific offset in an inactive log segment, I
> think it would be similar to log compaction, but it would be an expensive
> operation for just one record. If you wanted to do it for an active log
> segment, that's an entirely different prospect.
>
> I know people have done some tricks for GDPR to make records unreadable,
> so hopefully someone with more knowledge on this can add some information.
>
> Thanks,
> Andrew
>
> On 2026/07/20 06:56:03 Sri Chaitanya wrote:
> > Hi all,
> >
> > I wanted to ask about something I ran into recently. Is there any way
> > in Kafka to delete just one specific record from a partition, no
> > matter where it sits beginning, middle, or the latest one?
> >
> > From what I can tell, every deletion option we have today only works
> > on a range or a key, not a single record on its own. deleteRecords
> > only lets you wipe everything before a given offset. Retention just
> > clears out whole segments once they're old enough. And compaction can
> > get rid of a record, but only if the topic has keys and you publish a
> > tombstone for it it won't help if you just want to knock out one
> > specific offset in a non-compacted topic.
> >
> > So right now it seems like the only real option is to rebuild the
> > entire topic just to get rid of one message, which feels like a lot
> > for something this small.
> >
> > I ran into this because [explain what actually happened e.g. a bad
> > message got produced with the wrong data/some sensitive info in a
> > topic that isn't compacted, and there was no clean way to just remove
> > that one record].
> >
> > Wanted to check with the list before going further:
> >
> > - Has this come up before? I looked through JIRA and the KIP list but
> >   didn't find anything directly on this.
> > - Is this just not possible because of how replication and the log
> >   work, or is it more that nobody's built it yet?
> > - If it really can't be done at the log level, is there some
> >   workaround people already use for this kind of thing?
> >
> > Would appreciate any thoughts or pointers.
> >
> > Thanks,
> > Sri Chaitanya
> >
>

Reply via email to