jsancio commented on code in PR #19589:
URL: https://github.com/apache/kafka/pull/19589#discussion_r2075859850
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -3274,6 +3320,38 @@ private long pollFollowerAsVoter(FollowerState state,
long currentTimeMs) {
private long pollFollowerAsObserver(FollowerState state, long
currentTimeMs) {
if (state.hasFetchTimeoutExpired(currentTimeMs)) {
return maybeSendFetchToAnyBootstrap(currentTimeMs);
+ } else if (partitionState.lastKraftVersion().isReconfigSupported() &&
followersAlwaysFlush &&
+ quorumConfig.autoJoin() &&
state.hasUpdateVoterPeriodExpired(currentTimeMs)) {
+ /* `followersAlwaysFlush` is true when the config `process.roles`
contains "controller".
+ * We require both `followersAlwaysFlush` and `autoJoin` to be
true because
+ * brokers should not be able to add themselves as a KRaft voter.
+ */
Review Comment:
Let's remove any reference to "process.roles", "controller" and "broker". We
don't always succeed but we should try to make KRaft agnostic of cluster
metadata's use case. How about:
```java
/* Only replicas that are always flushing and are configured to auto join
should
* attempt to automatically join the voter set for the configured topic
partition.
*/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]