hachikuji commented on a change in pull request #9871:
URL: https://github.com/apache/kafka/pull/9871#discussion_r557725206



##########
File path: raft/src/main/java/org/apache/kafka/raft/QuorumState.java
##########
@@ -125,9 +125,16 @@ public void initialize(OffsetAndEpoch 
logEndOffsetAndEpoch) throws IOException,
         final EpochState initialState;
         if (!election.voters().isEmpty() && !voters.equals(election.voters())) 
{
             throw new IllegalStateException("Configured voter set: " + voters
-                + " is different from the voter set read from the state file: 
" + election.voters() +
-                ". Check if the quorum configuration is up to date, " +
-                "or wipe out the local state file if necessary");
+                + " is different from the voter set read from the state file: 
" + election.voters()
+                + ". Check if the quorum configuration is up to date, "
+                + "or wipe out the local state file if necessary");
+        } else if (election.hasVoted() && !isVoter()) {
+            String localIdDescription = localId.isPresent() ?
+                localId.getAsInt() + " is not a voter" :
+                "is undefined";
+            throw new IllegalStateException("Initialized quorum state " + 
election

Review comment:
       I thought I would start out strict and relax later if needed. Worst 
case, the user would just remove or edit the `quorum-state` file.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to