Handle case where broker address changes but node_id does not #440
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 a continuation/retry of #291 I had some time to dig in and, hopefully, the approach here is a bit more targeted. The idea is, if the host and/or port does not match what the broker_pool has in memory, there's no chance that connections will work and the in-memory broker information needs to be evicted. We're running this in production right now and have successfully pulled and replaced brokers without causing consumers to crash and/or enter into endless connection error loops. Let me know if there's anything else I can provide/tweak to help get this on its way upstream :)
Also, there's a bonus tweak in
lib/kafka/cluster.rb
:) When testing consumer resiliency I ran in to the situation where the coordinator was updated after the response with the old coordinator id came back. I added a single refresh + retry and never saw this happen again.