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.
| Version | Kafka | Changes |
|---|---|---|
| DeleteRecordsRequest | ||
| v0 | 2.2 | + Topics []DeleteRecordsTopic+ Name string+ Partitions []DeleteRecordsPartition+ PartitionIndex int32+ Offset int64+ TimeoutMs int32 |
| v1 | 2.2 | is the same as version 0. |
| v2 | 2.6 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| DeleteRecordsResponse | ||
| v0 | 2.2 | + ThrottleTimeMs int32+ Topics []DeleteRecordsTopicResult+ Name string+ Partitions []DeleteRecordsPartitionResult+ PartitionIndex int32+ LowWatermark int64+ ErrorCode int16 |
| v1 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v2 | 2.6 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |