Git Product home page Git Product logo

Comments (6)

twmb avatar twmb commented on June 24, 2024

There is, but it's a pretty big risk to have any fallback to the old AlterConfigsRequest.

What you could do is to send ApiVersionsRequest, pass the response to kversion.FromApiVersionsResponse, and then check HasKey(<request key>).

If the response does not have the incremental key, then you could fallback to non-incremental.

The big risk is that AlterConfigs does not preserve any prior configuration, and even if you DescribeConfigs beforehand to try to preserve configuration, DescribeConfigs does not return secrets. Secrets cannot be preserved with AlterConfigs -- you may have seen this in the kcl repo where I have a prompt for configuration that will be lost.

from franz-go.

peter-evans avatar peter-evans commented on June 24, 2024

Thank you! I'll take a look at using ApiVersionsRequest as you suggested.

I understand your explanation of the risk and I'll make sure it's clear to the user if my client is going to do something that might be destructive. 👍

from franz-go.

twmb avatar twmb commented on June 24, 2024

One other small risk is if your ApiVersions request goes to a new broker in a cluster that supports incremental update, while old brokers that do not are still in the cluster. This gets really tricky to solve correctly and IMO it's not worth it; Kafka authors have seen the problem here and are actually introducing a new "supported features" bit in MetadataResponse, but that's very new and they return nothing in it yet.

Happy to have helped, and happy you're checking out this library!

from franz-go.

peter-evans avatar peter-evans commented on June 24, 2024

One other small risk is if your ApiVersions request goes to a new broker in a cluster that supports incremental update, while old brokers that do not are still in the cluster.

In this situation, if the client chose to use incremental update and the request went to a broker that didn't support the feature, do you know off-hand what would happen? Would it return one of these errors, perhaps INVALID_REQUEST?

from franz-go.

twmb avatar twmb commented on June 24, 2024

Kafka actually closes the connection, and the client has no knowledge of why. The client will retry, if it retries enough it should hit the broker that supported the request anyway. But, if you're trying to modify configs on the broker that doesn't support the request, the connection will be closed a bunch and then the client will hit the request retry limit.

from franz-go.

peter-evans avatar peter-evans commented on June 24, 2024

Um, sounds complicated. I can see why you think it's not worth it!

Thanks for the info. Very helpful.

from franz-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.