[ 
https://issues.apache.org/jira/browse/KAFKA-21723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Schofield resolved KAFKA-21723.
--------------------------------------
    Resolution: Fixed

> Unstable ApiVersions RPC handling incorrect
> -------------------------------------------
>
>                 Key: KAFKA-21723
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21723
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 4.5.0
>            Reporter: Andrew Schofield
>            Assignee: Andrew Schofield
>            Priority: Major
>             Fix For: 4.5.0
>
>
> The handling of the ApiVersions RPC is different than all the other RPCs 
> because it is used to negotiate RPC version support between clients and 
> brokers.
> The client sends the highest version number it understands which the broker 
> may not understand. If the broker receives a version higher than it supports, 
> it responds with a v0 response containing the supported version information 
> just for the ApiVersions RPC, and then the client chooses a supported version 
> and tries again.
> When the code was written, it did not take into account the possibility that 
> the latest version of ApiVersions might be marked as unstable. The behaviour 
> is a bit odd, as illustrated below.
>  * trunk supports ApiVersions v5 as stable, and v6 is unstable
>  * trunk clients send v6 requests, which the broker responds with error code 
> NONE and the valid version range for ApiVersions as 0 to 5. The client does 
> not need to negotiate because it did not get an error.
>  * If unstable API versions are enabled, trunk behaves exactly the same 
> except the response contains the valid version range for ApIVersions as 0 to 
> 6.
>  * If the broker does respond to an invalid ApiVersions request, the valid 
> version range in its response for ApiVersions is 0 to 6, regardless of 
> whether unstable API versions are enabled.
> Here's what should happen.
>  * If unstable API versions are not enabled, the valid version range is 0 to 
> 5. The client will send a v6 request which is the latest version it knows. 
> The broker will reject this with UNSUPPORTED_VERSION, and report the valid 
> version range for ApiVersions as 0 to 5. Then the client sends a v5 request 
> which succeeds.
>  * If unstable API versions are enabled, the valid version range is 0 to 6. 
> The client will send a v6 request which succeeds with no version negotiation.
>  * When v6 is marked as stable before 4.5.0 releases, the client and broker 
> will agree that v6 is the latest stable version and no negotiation will be 
> necessary.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to