KAFKA-20380: controller.quorum.voters should act as advertised.listeners if the latter is not defined#21918
KAFKA-20380: controller.quorum.voters should act as advertised.listeners if the latter is not defined#21918kevin-wu24 wants to merge 4 commits intoapache:trunkfrom
Conversation
…er.quorum.voters, which is expected to be routable
jsancio
left a comment
There was a problem hiding this comment.
Thanks for the fix @kevin-wu24 . Quick review to provide feedback on the strategy used to solve this problem.
| // should be determined from the static voter set since the local listeners may | ||
| // not be a routable address for other voters in the cluster. | ||
| Endpoints leaderEndpoints = partitionState.lastKraftVersion().isReconfigSupported() | ||
| ? localListeners |
There was a problem hiding this comment.
Did you consider fixing this by making sure that the localListener passed to KafkaRaftClient is always correct?
There was a problem hiding this comment.
I did consider that approach, but my main question was:
How does the caller of the KafkaRaftClient constructor, KafkaRaftManager, know what its current kraft version is without reading the entire log prior to constructing the client? The KRaftControlRecordStateMachine already does this read within KRaft.
There was a problem hiding this comment.
Local endpoint is computed using the configuration. The resolution logic could be in this order:
- Use the advertise listener if it exists
- Use the controller.quorum.voters if it exists
- Do a reverse lookup of the listener.
There was a problem hiding this comment.
I see. This issue is technically independent of kraft.version. Let me update the JIRA to reflect that.
…controller.quorum.voters, which is expected to be routable" This reverts commit 14bd70c.
…uorum.voters if defined
|
Thanks for the feedback @jsancio. I have pushed some changes to make sure the |
What Changed
KafkaConfig#effectiveAdvertisedControllerListeners, whenadvertised.listenersis not defined butcontroller.quorum.votersis,we should advertise the
controller.quorum.votersendpoint.Testing
Unit tests in
KafkaConfigTest.