spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wenxuan Guan <>
Subject Re: [SS]Kafka EOS transaction timeout solution
Date Wed, 04 Sep 2019 06:49:15 GMT
Thanks for your reply.
1. About submit tasks to commit kafka transaction
kafka producer commit transaction is lightweight action, compared with
sending message to kafka, there is little chance to fail in commit
transaction. However to implement EOS, we must consider commit transaction
fail, and we should focus on transaction commit timeout.
2. About transaction commit timeout
I agree with you to notice user. In addition to set ``
configure and notice user in doc, maybe we can do something to resend data
to kafka, fall back to at-least-once, when find transaction timeout, right?

Genmao Yu <> 于2019年9月3日周二 上午11:39写道:

> Increasing `` in both kafka client and server side
> may not be a best but workable solution. In the design, spark will submit
> tasks to all executors to do kafka commit (the second phase in 2PC). This
> will increase the possibility of commit failure. Besides, users may be
> clear that if kafka transaction commit timeout, the exactly-once may fall
> back to at-least-once.
> wenxuan Guan <> 于2019年8月31日周六 下午3:42写道:
>> Hi all,
>> I have implement Structured Streaming Kafka sink EOS with Kafka
>> transaction producer, and design sketch is in <a href="
>>">SPARK-28908</a> and
>> pr in <a href="">25618</a>.
>> But now I meet a problem as blow.
>> When producer failed to commit transaction after successfully send data
>> to Kafka for some reason, such as kafka broker down, spark job will fail
>> down. After kafka broker recovered, restart the job and transaction will
>> resume. But if the time between transaction commit failure fixed and job
>> restart by job attempt or manually exceed the config `
>>`, data send by producer will be discard by kafka
>> broker, leading to data loss.
>> My solution is
>> 1.Increase the config ``.
>>  Set the config from 60 seconds, the default value of `
>>` in producer, to 15 minutes, the default value of
>> config `` in Kafka broker if user not defined.
>> Because the request will fail with a InvalidTransactionTimeout error if `
>>` is larger than ``. And
>> if user defined`, we just check if it is larger
>> enough.
>> 2.Notice user the config `` in document, and
>> introduce some solution to avoid data loss, such as increase config `
>>` and ``, and avoid
>> exceed the time.
>> BTW, I just skimmed the code in Flink, and found by default flink set the
>> `` property in producer config to 1 hour, and
>> notice user to increase `` in doc.
>> Any idea about how to handle this problem?
>> Many Thanks,
>> Wenxuan

View raw message