You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Ming-Yen Chung <mi...@gmail.com> on 2025/08/19 14:59:40 UTC
[DISCUSS] KIP-1205: Improve RecordHeader to be Thread-Safe
Hi all,
I would like to start a discussions on KIP-1205: Improve RecordHeader to be
Thread-Safe:
https://cwiki.apache.org/confluence/display/KAFKA/KIP-1205%3A+Improve+RecordHeader+to+be+Thread-Safe
This proposal uses double-checked locking and volatile to make RecordHeader
thread-safe.
Best,
Ming-Yen
Re: [DISCUSS] KIP-1205: Improve RecordHeader to be Thread-Safe
Posted by Ming-Yen Chung <mi...@gmail.com>.
Hi Chia-Ping,
Thanks for your comments and feedback. I’ve updated the KIP as follows:
chia_00: Refined the description.
chia_01: Added a conclusion for the benchmark. The thread-safe
implementation adds only negligible overhead (~0.3 ns) during the first
initialization.
chia_02: Added unit tests to the Test Plan.
Best,
Ming-Yen
Chia-Ping Tsai <ch...@gmail.com> 於 2025年8月20日 週三 下午3:16寫道:
> hi Ming
>
> Thanks for this KIP. please take a look at following questions
>
> chia_00:
> The description “ Note that because the Consumer is not thread-safe, if
> other threads can modify the RecordHeader through the Consumer, its
> thread-safety can no longer be guaranteed.” is a bit weird to me. Did you
> mean RecordHeaders
>
> chia_01:
>
> Could you please add conclusion for the benchmark? It seems the
> performance regression caused by double check is very small, right?
>
> chia_02:
>
> JMH is not included by our CI, so it would be helpful to write a UT.
>
> Best,
> Chia-Ping
>
>
> > Ming-Yen Chung <mi...@gmail.com> 於 2025年8月19日 晚上11:00 寫道:
> >
> > Hi all,
> >
> > I would like to start a discussions on KIP-1205: Improve RecordHeader to
> be
> > Thread-Safe:
> >
> >
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-1205%3A+Improve+RecordHeader+to+be+Thread-Safe
> >
> > This proposal uses double-checked locking and volatile to make
> RecordHeader
> > thread-safe.
> >
> >
> > Best,
> > Ming-Yen
>
Re: [DISCUSS] KIP-1205: Improve RecordHeader to be Thread-Safe
Posted by Chia-Ping Tsai <ch...@gmail.com>.
hi Ming
Thanks for this KIP. please take a look at following questions
chia_00:
The description “ Note that because the Consumer is not thread-safe, if other threads can modify the RecordHeader through the Consumer, its thread-safety can no longer be guaranteed.” is a bit weird to me. Did you mean RecordHeaders
chia_01:
Could you please add conclusion for the benchmark? It seems the performance regression caused by double check is very small, right?
chia_02:
JMH is not included by our CI, so it would be helpful to write a UT.
Best,
Chia-Ping
> Ming-Yen Chung <mi...@gmail.com> 於 2025年8月19日 晚上11:00 寫道:
>
> Hi all,
>
> I would like to start a discussions on KIP-1205: Improve RecordHeader to be
> Thread-Safe:
>
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-1205%3A+Improve+RecordHeader+to+be+Thread-Safe
>
> This proposal uses double-checked locking and volatile to make RecordHeader
> thread-safe.
>
>
> Best,
> Ming-Yen