Yes thanks Manikumar! I just tested this and it is indeed all in and working
great in 0.11! I thought I would have to wait until 1.0 to be able to use and
recommend this in production.
I published 100 messages
seq 100 | ./bin/kafka-console-producer.sh --broker-list localhost:9092
--topic mytest
then deleted 90 of those 100 messages with the new kafka-delete-records.sh
command line tool
./bin/kafka-delete-records.sh --bootstrap-server localhost:9092
--offset-json-file ./offsetfile.json
where offsetfile.json contains
{"partitions": [{"topic": “mytest", "partition": 0, "offset": 90}],
"version":1 }
and then consume the messages from the beginning to verify that 90 of the 100
messages are indeed deleted.
./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092
--topic mytest --from-beginning
91
92
93
94
95
96
97
98
99
100
-hans
> On Aug 18, 2017, at 10:32 AM, Manikumar <[email protected]> wrote:
>
> This feature got released in Kafka 0.11.0.0. You can
> use kafka-delete-records.sh script to delete data.
>
> On Sun, Aug 13, 2017 at 11:27 PM, Hans Jespersen <[email protected]> wrote:
>
>> This is an area that is being worked on. See KIP-107 for details.
>>
>> https://cwiki.apache.org/confluence/display/KAFKA/KIP-
>> 107%3A+Add+purgeDataBefore%28%29+API+in+AdminClient <
>> https://cwiki.apache.org/confluence/display/KAFKA/KIP-
>> 107:+Add+purgeDataBefore()+API+in+AdminClient>
>>
>> -hans
>>
>>
>>> On Aug 10, 2017, at 10:52 AM, Sven Ludwig <[email protected]> wrote:
>>>
>>> Hello,
>>>
>>> assume that all producers and consumers regarding a topic-partition have
>> been shutdown.
>>>
>>> Is it possible in this situation to empty that topic-partition, while
>> the other topic-partitions keep working?
>>>
>>> Like for example, is it possible to trigger a log truncation to 0 on the
>> leader for that partition using some admin tool?
>>>
>>> Kind Regards,
>>> Sven
>>>
>>
>>