Current state: "Accepted"
Discussion thread: here
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
The KIP-107 provides a way to delete messages starting from a specified offset inside a topic partition which we don’t want to take anymore so without relying on time-based and size-based log retention policies. The already implemented protocol request and response messages (DeleteRecords API, key 21) are used only by the “legacy” Admin Client in Scala and aren’t provided by the new Admin Client API in Java. This KIP is about adding this feature to the new Admin Client API.
Note that this KIP is related to KIP-107.
The AdminClient API will have new methods added (plus overloads for options):
AdminClient : deleteRecords()
TopicPartition comes from
RecordsToDelete, DeleteRecordsOptions and
DeleteRecordsResult are defined as follow.
DeleteRecordsResult, the Long value accessed by
all() method specifies the low watermark as described in the KIP-107.
The deleteRecords() will have the same authorization setting as
deleteTopic(). Its operation type is be DELETE and its resource type is TOPIC.
Compatibility, Deprecation, and Migration Plan
This is a new API and won't directly affect existing users.
It should replace the deleteRecordsBefore() method provided by the Scala based Admin Client. So existing users who are using such method, should migrate to use the new Java based Admin Client for this feature.
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.