ahuang98 commented on code in PR #19416:
URL: https://github.com/apache/kafka/pull/19416#discussion_r2034166958
##########
raft/src/main/java/org/apache/kafka/raft/FollowerState.java:
##########
@@ -38,19 +40,20 @@ public class FollowerState implements EpochState {
private final Set<Integer> voters;
// Used for tracking the expiration of both the Fetch and FetchSnapshot
requests
private final Timer fetchTimer;
+ // Used to throttle update voter request and allow for Fetch/FetchSnapshot
requests
Review Comment:
suggestion: `Used to track when to send another update voter request`
(I understand that the follower won't _always_ send an updateVoterRequest
when the updateVoterPeriod has expired. Just feel the original comment didn't
make much sense to me w/o reading the code)
##########
metadata/src/main/java/org/apache/kafka/controller/FeatureControlManager.java:
##########
@@ -225,6 +257,23 @@ private ApiError updateFeature(
if (featureName.equals(MetadataVersion.FEATURE_NAME)) {
// Perform additional checks if we're updating metadata.version
return updateMetadataVersion(newVersion,
upgradeType.equals(FeatureUpdate.UpgradeType.UNSAFE_DOWNGRADE), records::add);
+ } else if (featureName.equals(KRaftVersion.FEATURE_NAME)) {
+ if (upgradeType.equals(FeatureUpdate.UpgradeType.UPGRADE)) {
+ try {
+ if (!validateOnly) {
+ raftClient.upgradeKRaftVersion(currentClaimedEpoch,
KRaftVersion.fromFeatureLevel(newVersion));
+ }
+ return ApiError.NONE;
Review Comment:
we always return 'success' in the validateOnly case?
##########
raft/src/main/java/org/apache/kafka/raft/FollowerState.java:
##########
@@ -38,19 +40,20 @@ public class FollowerState implements EpochState {
private final Set<Integer> voters;
// Used for tracking the expiration of both the Fetch and FetchSnapshot
requests
private final Timer fetchTimer;
+ // Used to throttle update voter request and allow for Fetch/FetchSnapshot
requests
+ private final Timer updateVoterPeriodTimer;
+
/* Used to track if the replica has fetched successfully from the leader
at least once since the transition to
* follower in this epoch. If the replica has not yet fetched
successfully, it may be able to grant PreVotes.
*/
- private boolean hasFetchedFromLeader;
+ private boolean hasFetchedFromLeader = false;
private Optional<LogOffsetMetadata> highWatermark;
+ // For kraft.version 0, track if the leader has recieved updated voter
information
Review Comment:
nit: received updated voter information from this follower
--
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]