kafka-go icon indicating copy to clipboard operation
kafka-go copied to clipboard

Before writing Client request all Topics from the Cluster

Open wesleyvicthor opened this issue 4 years ago • 3 comments

I am not considering this a bug, rather something to understand why as I have faced bad symptoms. Describe the bug For every WriteMessage, Kafka client requests all Topics from the Cluster, then filter those by the given Message topic. This is making the cluster to log attempts of topic creation, thus flooding the cluster. This was identified by the client's user issuing the request.

Question: Is there a way to prevent the Client from requesting those Topics ? Instead just using the Topic which is provided by the Message or the Writer ?

Kafka Version 2.6.1

To Reproduce Have a cluster with many topics. Have info logging of this cluster. Publish a message to a specific topic. Check the cluster logging interaction on not owned topic by the previous issued request

Expected behavior Client should not interact with topics which it doesn't own, or request is not target at.

Additional context

wesleyvicthor avatar Jun 30 '21 13:06 wesleyvicthor

Hi @wesleyvicthor I'll be looking into this, as it's possibly related to the other issue I'm investigating (#683).

dtjm avatar Jul 09 '21 20:07 dtjm

Hi @dtjm , does this PR https://github.com/segmentio/kafka-go/pull/700 solve this behaviour ?

WaldoFR avatar Sep 22 '21 16:09 WaldoFR

@WaldoFR it does for this particular repro case, but it causes other tests to fail, so I'm afraid it's probably introducing some regressions. I've gotten deep in the weeds of making sure I didn't break anything else, but you are welcome to test the branch and see if it works for your case.

dtjm avatar Sep 22 '21 17:09 dtjm