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.
Wire Diagram
Request Header
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string
DeleteRecordsRequest v0
TimeoutMs
int32 · 4B
Name
string
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 }