You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jsancio (via GitHub)" <gi...@apache.org> on 2024/08/17 18:19:01 UTC

[PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

jsancio opened a new pull request, #16907:
URL: https://github.com/apache/kafka/pull/16907

   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio commented on PR #16907:
URL: https://github.com/apache/kafka/pull/16907#issuecomment-2297147671

   
   > Do we need a test for the whole sequence of events (active quorum controller able to resign while it's being removed from quorum)?
   
   This is what this test does, no?
   https://github.com/apache/kafka/pull/16907/files#diff-7aff64bce972580ab7e3944ec93cc2ee9a7d96346b356db92f3ac268436a4199R1122


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio merged PR #16907:
URL: https://github.com/apache/kafka/pull/16907


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

Posted by "ahuang98 (via GitHub)" <gi...@apache.org>.
ahuang98 commented on code in PR #16907:
URL: https://github.com/apache/kafka/pull/16907#discussion_r1721992481


##########
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientReconfigTest.java:
##########
@@ -1112,7 +1112,14 @@ public void testRemoveVoterIsLeader() throws Exception {
 
         // Expect END_QUORUM_EPOCH requests
         context.pollUntilRequest();
-        context.collectEndQuorumRequests(epoch, new HashSet<>(Arrays.asList(follower1.id(), follower2.id())), Optional.empty());
+        context.collectEndQuorumRequests(
+            epoch,
+            new HashSet<>(Arrays.asList(follower1.id(), follower2.id())),
+            Optional.empty()
+        );
+
+        // Calls to resign should be allowed and not throw an exception
+        context.client.resign(epoch);
 
         // Election timeout is randome numer in [electionTimeoutMs, 2 * electionTimeoutMs)

Review Comment:
   nit: could we change to `random number` while we're at it?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #16907:
URL: https://github.com/apache/kafka/pull/16907#discussion_r1722304237


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -229,6 +230,7 @@ public KafkaRaftClient(
         Time time,
         ExpirationService expirationService,
         LogContext logContext,
+        boolean alwaysFlush,

Review Comment:
   A comment or javadoc explaining this flag would be useful.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

Posted by "ahuang98 (via GitHub)" <gi...@apache.org>.
ahuang98 commented on PR #16907:
URL: https://github.com/apache/kafka/pull/16907#issuecomment-2297428899

   > This is what this test does, no?
   https://github.com/apache/kafka/pull/16907/files#diff-7aff64bce972580ab7e3944ec93cc2ee9a7d96346b356db92f3ac268436a4199R1122
   
   In a way it does, but that's just testing the raft layer in a sense. I was wondering if we wanted to test the flow outside of the raft layer as well - that the quorum controller behaves correctly on remove_voter and calls `renounce()` etc. 


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-17332; Controller always flush and can call resign on observers [kafka]

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio commented on code in PR #16907:
URL: https://github.com/apache/kafka/pull/16907#discussion_r1722168926


##########
raft/src/test/java/org/apache/kafka/raft/KafkaRaftClientReconfigTest.java:
##########
@@ -1112,7 +1112,14 @@ public void testRemoveVoterIsLeader() throws Exception {
 
         // Expect END_QUORUM_EPOCH requests
         context.pollUntilRequest();
-        context.collectEndQuorumRequests(epoch, new HashSet<>(Arrays.asList(follower1.id(), follower2.id())), Optional.empty());
+        context.collectEndQuorumRequests(
+            epoch,
+            new HashSet<>(Arrays.asList(follower1.id(), follower2.id())),
+            Optional.empty()
+        );
+
+        // Calls to resign should be allowed and not throw an exception
+        context.client.resign(epoch);
 
         // Election timeout is randome numer in [electionTimeoutMs, 2 * electionTimeoutMs)

Review Comment:
   Fixed.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org