Versions Compared

Key

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

...

  1. A new ApiVersionRequest and Response type (version 0) will be added to allow clients to query the broker for supported API request types and versions.

    Code Block
    ApiVersionRequest => ApiKeys
      ApiKeys = [INT16]
     
    ApiVersionResponse => ApiVersions
      ApiVersions = [ApiVersion]
        ApiVersion = ApiKey ErrorCode MinVersion MaxVersion
          ApiKey = INT16
          ErrorCode = INT16
          MinVersion = INT16
          MaxVersion = INT16
    
    New error code:
     NotSupportedCode - API request or operation not supported by broker. 
  2. ApiVersionRequest.ApiKeys semantics:

    1. Null array (size -1): return ApiVersions for all APIs supported by broker.

    2. Array of some ApiKeys: return ApiVersions for the requested API keys only.

  3. ApiVersionResponse..MinVersion-MaxVersion semantics:
    1. ErrorCode:
      1. ErrorCode 0: ApiKey supported between MinVersion..MaxVersion
      2. ErrorCode NotSupportedCode: requested ApiKey not supported by broker (MinVersion and MaxVersion are not set).
    2. MinVersion and MaxVersion dictates the lowest and highest supported API versions for the API key (inclusive).
    3. All versions in the MinVersion-MaxVersion must be supported by the broker. Specific version may be deprecated through protocol documentation but must still be supported (broker must not disconnect the client and return a valid protocol response, although it is valid to return an error code if the specific API supports it).
  4. Clients are recommended to use latest common supported API version.

  5. Deprecation of a protocol version will be done by marking a protocol version as deprecated in protocol documentation. Documentation shall also be used to indicate a protocol version that must not be used, or for any such information. For instance, say 0.9.0 had protocol versions [0] for api key 1. On trunk, version 1 of the api key was added. Users running off trunk started using version 1 of the api and found out a major bug. To rectify that version 2 of the api is added to trunk. For some reason, it is now deemed important to have version 2 of the api in 0.9.1 as well. To do so, version 1 and version 2 both of the api will be backported to the 0.9.1 branch. 0.9.1 broker will return 0 as min supported version for the api and 2 for the max supported version for the api. However, the version 1 should be clearly marked as deprecated on its documentation. It will be client's responsibility to make sure they are not using any such deprecated version to the best knowledge of the client at the time of development (or alternatively by configuration). 
    Note that backporting of protocols has not been done in Kafka so far and in practice it can not be done until the Java client is changed so that it doesn't blindly use the latest protocol version. Otherwise, if new request versions were added to 0.9.0.2, the client would not be able to talk to a 0.9.0.1 broker.
  6. Supported protocol versions obtained from a broker, is good only for current connection on which that information is obtained. In the event of disconnection, the client should obtain the information from the broker again, as the broker might have upgraded/ downgraded in the mean time.

  7. Versions of ApiVersion api should never be deprecated, as clients will rely on the api to inquire supported versions.
  8. Java clients will use this API to assert that current API versions are all supported by the brokers it is talking to, and raise an exception if they are not. Java clients check will test the new API.
  9. The new API will be tested with librdkafka's implementation as well.
  10. The broker is free to ignore duplicate ApiKeys in the request and may not preserve ordering.

...