sink(cdc): kafka producer use default configuration. (#4359) #4546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #4359
What problem does this PR solve?
Issue Number: close #4383, close #4499
If the network condition between the TiCDC and Kafka is not good enough, let producer get responses from Kafka as soon as possible, to prevent waste too much time
.What is changed and how it works?
change kafka producer to use default configurations, to prevent wast too much time on network communication with a Kafka cluster in bad network conditions.
Net.DialTimeout
,Net.WriteTimeout
,Net.ReadTimeout
to10s
Metadata.Retry.Max
to 1, to makeRefreshMatadata
return fastCheck List
Tests
as shown in the log above, the owner can be closed in around 1 second.
10s later, the changefeed restart, and failed in around 1 second again.
18s later, the changefeed restart again....
the restart logic is handled by
feed_state_manager
.When the Kafka cluster is in a bad network condition, this configuration will detect it very fast, to prevent wasting too much time. But this would also have a false-negative case, such as the user's network is just not fast enough...
It looks that the processor should be fully closed before the owner tries to initialize the changefeed again. Or, the owner shouldn't try to initialize the changefeed before the processor is not fully closed.
Code changes
Side effects
Related changes
Release note