MINOR: MockClient's disconnect() method has two bugs#183
Conversation
|
kafka-trunk-git-pr #278 SUCCESS |
|
*tries to remove a String from a Set of Integer. |
|
The changes look good, but it why was |
|
Hi @ijuma, it is passing because the All in all, those are bugs lurking to happen, and I only stumbled upon by chance as MockClient. Do you think it's worth trying to devise an assertion that expose at least the collection flaw? I am fine with this approach, committing as-is today, or even dropping this PR. :) |
|
I think it would be nice to have the assertion you suggest, if it's easy to do yes. Whatever happens, the fixes in the PR are good and should be included. |
|
okay 👍 I am gonna include an assertion yet today. :) |
|
Hi @ijuma, I have exposed a internal field of MockClient (same spirit of |
|
Why not use the existing |
|
kafka-trunk-git-pr #300 SUCCESS |
|
Hi @ijuma, good question. In fact, I didn't want to create a new Node just to test it, but looking again I should have been done that. Gonna change now. Btw, did you see that |
|
Sounds good. Yes, the mocks often ignore parameters if not needed for the existing tests. |
|
@ijuma please, tell me if it's good. Thx! |
|
Well, your change looked good, but now I am seeing a number of new commits in this branch? Seems like a merge/rebase gone wrong. |
|
Yeah, has just fixed that. Sorry! |
|
LGTM |
|
kafka-trunk-git-pr #329 FAILURE |
|
Urgh, the failures in the Jenkins build above looks unrelated to my changes (see below): So, I am rebasing again. Hope this helps. |
|
kafka-trunk-git-pr #331 FAILURE |
|
kafka-trunk-git-pr #335 SUCCESS |
|
kafka-trunk-git-pr #370 FAILURE |
…e refactoring) * First, it compares Strings using `==` instead of `equals()` * Second, it tries to remove a String from a Set<Integer>. As disconnect() method is only called by a single method on SenderTest then it's safe to refactor it to make it both explicity that its argument is a node id and do a Integer.valueOf() before trying to remove from `ready`. * Third, not a bug, but the Iterator logic can be simplified, shrinking the scope of the Iterator without changing the logic.
Add a message to Assertion
|
kafka-trunk-git-pr #607 FAILURE |
|
@eribeiro, can you please close this as it has been merged? |
…ic (apache#183) Enable RBAC authorization in brokers hosting RBAC metadata topic, with the limitation that brokers themselves can be authorized without RBAC, using ACLs or as super.users. SocketServer will start inter-broker listeners first, wait for Authorizer to load RBAC metadata from the Kafka topic and then start other listeners. This ensures that Authorizer is fully initialized before external users that rely on RBAC are authorized. Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
…he listTopics() API (apache#183) TICKET = LIKAFKA-37320 LI_DESCRIPTION = Making the listTopics() API more light-weight so that a kafka broker would only return the topic names in the MetadataResponse. The partitions and replicas info would not be included in the MetadataResponse for the listTopics() API. EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release.
…he listTopics() API (apache#289) This is a squash of 2 commits: * [LI-HOTFIX] Exclude the partitions info in the MetadataResponse for the listTopics() API (apache#183) * [LI-HOTFIX] Making the ExcludePartitions field in MetadataRequest an optional field (apache#193) Compared to the original implementation, which uses the topic names directly during `excludePartitions = true`, this new implementation will still visit the metadata cache in order to obtain the topic Id info. ==1st commit message== [LI-HOTFIX] Exclude the partitions info in the MetadataResponse for the listTopics() API (apache#183) TICKET = LIKAFKA-37320 LI_DESCRIPTION = Making the listTopics() API more light-weight so that a kafka broker would only return the topic names in the MetadataResponse. The partitions and replicas info would not be included in the MetadataResponse for the listTopics() API. EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release. ==2nd commit message== [LI-HOTFIX] Making the ExcludePartitions field in MetadataRequest an optional field (apache#193) TICKET = LIKAFKA-37320 LI_DESCRIPTION = After the change made in b28666d, an old client version sending a MetadataRequest without the "ExcludePartitions" field to a new kafka server version expecting the field will result in the exception below. This PR turns the "ExcludePartitions" field into an optional one introduced in KIP-482. org.apache.kafka.common.errors.InvalidRequestException: Error getting request for apiKey: METADATA, apiVersion: 9, connectionId: 10.154.165.183:16637-10.154.87.109:44876-2848, listenerName: ListenerName(SSL), principal: User:likafka-cruise-control:None:prod-ltx1 at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:70) ~[kafka-clients-2.4.1.26.jar:?] at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:89) ~[kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.$anonfun$processCompletedReceives$1(SocketServer.scala:928) ~[kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.$anonfun$processCompletedReceives$1$adapted(SocketServer.scala:909) ~[kafka_2.12-2.4.1.26.jar:?] at scala.collection.Iterator.foreach(Iterator.scala:941) [scala-library-2.12.10.jar:?] at scala.collection.Iterator.foreach$(Iterator.scala:941) [scala-library-2.12.10.jar:?] at scala.collection.AbstractIterator.foreach(Iterator.scala:1429) [scala-library-2.12.10.jar:?] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [scala-library-2.12.10.jar:?] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [scala-library-2.12.10.jar:?] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [scala-library-2.12.10.jar:?] at kafka.network.Processor.processCompletedReceives(SocketServer.scala:909) [kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.run(SocketServer.scala:799) [kafka_2.12-2.4.1.26.jar:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: org.apache.kafka.common.protocol.types.SchemaException: Error reading field '_tagged_fields': java.nio.BufferUnderflowException at org.apache.kafka.common.protocol.types.Schema.read(Schema.java:118) ~[kafka-clients-2.4.1.26.jar:?] at org.apache.kafka.common.protocol.ApiKeys.parseRequest(ApiKeys.java:327) ~[kafka-clients-2.4.1.26.jar:?] at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:65) ~[kafka-clients-2.4.1.26.jar:?] ... 12 more EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release. Co-authored-by: Lucas Wang <luwang@linkedin.com>
…he listTopics() API (apache#289) This is a squash of 2 commits: * [LI-HOTFIX] Exclude the partitions info in the MetadataResponse for the listTopics() API (apache#183) * [LI-HOTFIX] Making the ExcludePartitions field in MetadataRequest an optional field (apache#193) Compared to the original implementation, which uses the topic names directly during `excludePartitions = true`, this new implementation will still visit the metadata cache in order to obtain the topic Id info. ==1st commit message== [LI-HOTFIX] Exclude the partitions info in the MetadataResponse for the listTopics() API (apache#183) TICKET = LIKAFKA-37320 LI_DESCRIPTION = Making the listTopics() API more light-weight so that a kafka broker would only return the topic names in the MetadataResponse. The partitions and replicas info would not be included in the MetadataResponse for the listTopics() API. EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release. ==2nd commit message== [LI-HOTFIX] Making the ExcludePartitions field in MetadataRequest an optional field (apache#193) TICKET = LIKAFKA-37320 LI_DESCRIPTION = After the change made in b28666d, an old client version sending a MetadataRequest without the "ExcludePartitions" field to a new kafka server version expecting the field will result in the exception below. This PR turns the "ExcludePartitions" field into an optional one introduced in KIP-482. org.apache.kafka.common.errors.InvalidRequestException: Error getting request for apiKey: METADATA, apiVersion: 9, connectionId: 10.154.165.183:16637-10.154.87.109:44876-2848, listenerName: ListenerName(SSL), principal: User:likafka-cruise-control:None:prod-ltx1 at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:70) ~[kafka-clients-2.4.1.26.jar:?] at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:89) ~[kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.$anonfun$processCompletedReceives$1(SocketServer.scala:928) ~[kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.$anonfun$processCompletedReceives$1$adapted(SocketServer.scala:909) ~[kafka_2.12-2.4.1.26.jar:?] at scala.collection.Iterator.foreach(Iterator.scala:941) [scala-library-2.12.10.jar:?] at scala.collection.Iterator.foreach$(Iterator.scala:941) [scala-library-2.12.10.jar:?] at scala.collection.AbstractIterator.foreach(Iterator.scala:1429) [scala-library-2.12.10.jar:?] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [scala-library-2.12.10.jar:?] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [scala-library-2.12.10.jar:?] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [scala-library-2.12.10.jar:?] at kafka.network.Processor.processCompletedReceives(SocketServer.scala:909) [kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.run(SocketServer.scala:799) [kafka_2.12-2.4.1.26.jar:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: org.apache.kafka.common.protocol.types.SchemaException: Error reading field '_tagged_fields': java.nio.BufferUnderflowException at org.apache.kafka.common.protocol.types.Schema.read(Schema.java:118) ~[kafka-clients-2.4.1.26.jar:?] at org.apache.kafka.common.protocol.ApiKeys.parseRequest(ApiKeys.java:327) ~[kafka-clients-2.4.1.26.jar:?] at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:65) ~[kafka-clients-2.4.1.26.jar:?] ... 12 more EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release. Co-authored-by: Lucas Wang <luwang@linkedin.com>
…he listTopics() API (apache#289) This is a squash of 2 commits: * [LI-HOTFIX] Exclude the partitions info in the MetadataResponse for the listTopics() API (apache#183) * [LI-HOTFIX] Making the ExcludePartitions field in MetadataRequest an optional field (apache#193) Compared to the original implementation, which uses the topic names directly during `excludePartitions = true`, this new implementation will still visit the metadata cache in order to obtain the topic Id info. ==1st commit message== [LI-HOTFIX] Exclude the partitions info in the MetadataResponse for the listTopics() API (apache#183) TICKET = LIKAFKA-37320 LI_DESCRIPTION = Making the listTopics() API more light-weight so that a kafka broker would only return the topic names in the MetadataResponse. The partitions and replicas info would not be included in the MetadataResponse for the listTopics() API. EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release. ==2nd commit message== [LI-HOTFIX] Making the ExcludePartitions field in MetadataRequest an optional field (apache#193) TICKET = LIKAFKA-37320 LI_DESCRIPTION = After the change made in b28666d, an old client version sending a MetadataRequest without the "ExcludePartitions" field to a new kafka server version expecting the field will result in the exception below. This PR turns the "ExcludePartitions" field into an optional one introduced in KIP-482. org.apache.kafka.common.errors.InvalidRequestException: Error getting request for apiKey: METADATA, apiVersion: 9, connectionId: 10.154.165.183:16637-10.154.87.109:44876-2848, listenerName: ListenerName(SSL), principal: User:likafka-cruise-control:None:prod-ltx1 at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:70) ~[kafka-clients-2.4.1.26.jar:?] at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:89) ~[kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.$anonfun$processCompletedReceives$1(SocketServer.scala:928) ~[kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.$anonfun$processCompletedReceives$1$adapted(SocketServer.scala:909) ~[kafka_2.12-2.4.1.26.jar:?] at scala.collection.Iterator.foreach(Iterator.scala:941) [scala-library-2.12.10.jar:?] at scala.collection.Iterator.foreach$(Iterator.scala:941) [scala-library-2.12.10.jar:?] at scala.collection.AbstractIterator.foreach(Iterator.scala:1429) [scala-library-2.12.10.jar:?] at scala.collection.IterableLike.foreach(IterableLike.scala:74) [scala-library-2.12.10.jar:?] at scala.collection.IterableLike.foreach$(IterableLike.scala:73) [scala-library-2.12.10.jar:?] at scala.collection.AbstractIterable.foreach(Iterable.scala:56) [scala-library-2.12.10.jar:?] at kafka.network.Processor.processCompletedReceives(SocketServer.scala:909) [kafka_2.12-2.4.1.26.jar:?] at kafka.network.Processor.run(SocketServer.scala:799) [kafka_2.12-2.4.1.26.jar:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: org.apache.kafka.common.protocol.types.SchemaException: Error reading field '_tagged_fields': java.nio.BufferUnderflowException at org.apache.kafka.common.protocol.types.Schema.read(Schema.java:118) ~[kafka-clients-2.4.1.26.jar:?] at org.apache.kafka.common.protocol.ApiKeys.parseRequest(ApiKeys.java:327) ~[kafka-clients-2.4.1.26.jar:?] at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:65) ~[kafka-clients-2.4.1.26.jar:?] ... 12 more EXIT_CRITERIA = When this change is merged in upstream and the corresponding change is pulled into a future release. Co-authored-by: Lucas Wang <luwang@linkedin.com>
Running tests locally might fail due to Postgres container not being ready.
Add migration test for LE difference and source node down cases
(and a prospetive refactoring)
==instead ofequals()ready.