Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The client does not know which ApiVersions versions the broker supports as the ApiVersions is used for this purpose. Today, the client sends an ApiVersionsRequest (AVR) with the latest schema it is aware of. The broker handles it with the correct version if it knows it or sends back an ApiVersionsResponse v0 with an `UNSUPPORTED_VERSION` error to the client if it doesn't. When the client receives such error, it retries the whole process with the ApiVersionsRequest v0. It means that the broker won't get any additional information about the client if the client uses a newer version that the broker doesn't know about. To circumvent this, we propose to provide the supported version of the ApiVersionsRequest in the response sent back to the client by populating the existing `api_versions` field when the version is not supported (ErrorCode equals to `UNSUPPORTED_VERSION`). This allows enables the client to send use the latest version supported by the broker instead of failing all the way down defaulting to version 0.

At the moment, the ApiVersionsRequest is handled in two different places in the broker: 1) in the SaslServerAuthenticator (when used); and 2) in the KafkaApis. Both places will be updated to ensure that all clients work. We have decided to not refactor the handling of the ApiVersionsRequest for now and to leave it for further improvements.  

...