conduktor.io ↗

Kafka DeleteRecords Request Wire Format v1 — Binary Protocol Layout

What is DeleteRecords?

Advances the log start offset for partitions, effectively discarding records below that offset. Used by kafka-delete-records.sh for retention compaction and GDPR data deletion; the deleted data may remain on disk until the next log segment cleanup.

Related Errors

OFFSET_OUT_OF_RANGE · TOPIC_AUTHORIZATION_FAILED · UNKNOWN_TOPIC_OR_PARTITION

Wire Diagram

Request Header
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string
DeleteRecordsRequest v1
Topics array
TimeoutMs int32 · 4B
Name string
Partitions array
PartitionIndex int32 · 4B
Offset int64 · 8B

Schema & Example

Schema
{
  "Topics": [{
      "Name": string,
      "Partitions": [{
          "PartitionIndex": int32,
          "Offset": int64
      }]
  }],
  "TimeoutMs": int32
}
Example
{
  "Topics": [{
      "Name": "orders",
      "Partitions": [{
          "PartitionIndex": 3,
          "Offset": 284729
      }]
  }],
  "TimeoutMs": 30000
}