Versions Compared

Key

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

...

To circumvent this, we propose to enhance the fail back mechanism as follow:

  1. When a an unknown version of the ApiVersionsRequest is received by the broker, it continues to send fails back to ApiVersionsRequest v0 and sends back an ApiVersionsResponse (version 0) v0 with the UNSUPPORTED_VERSION error (as today) but the broker also populate populates the api_versions field to inform the consumer about with the supported versions version of the ApiVersionsRequest.
  2. When the client receives an a response, it tries to deserialise it with the version it expects. If the parsing fails, it fails back to version 0 of the ApiVersionsResponse and checks the ErrorCode. If an UNSUPPORTED_VERSION error , it leverage the information provided in the api_versions field to fail back to the higher version supported by the broker is received, the client gets the supported version provided in the ApiKeys field or default to version 0 if api_versions if the ApiKeys field is empty.

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.  

...

ApiVersions Request/Response Handling

As mentioned earlier, when when the client receives a response, it tries to deserialise it with the version it expects. If the parsing fails, it fails back to version 0 of the ApiVersionsResponse and checks the ErrorCode. If an UNSUPPORTED_VERSION error, it will use the VERSION error is received, the client gets the supported version provided in the ApiKeys field or default to version 0 if the ApiKeys field is empty. Then, it restarts the process with this version.

api_versions field of the ApiVersionsResponse and fail back to the higher version know by the broker  instead of defaulting to version 0. When the client receives an INVALID_REQUEST error, it will error out and close the connection.

...