[ 
https://issues.apache.org/jira/browse/KAFKA-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16835207#comment-16835207
 ] 

ASF GitHub Bot commented on KAFKA-8332:
---------------------------------------

kkonstantine commented on pull request #6695: KAFKA-8332: Restore determinism 
in protocol selection during JoinGroupRequest handling
URL: https://github.com/apache/kafka/pull/6695
 
 
   The transition from List to Set for the group of embedded protocols that is 
supported combined with implicit conversions in scala during map on collections 
discards the order of preference for the supported embedded protocols. This fix 
restores determinism of selection based on the order. This bug may affect any 
group of Kafka clients (Connect workers, Consumers) that support the same set 
of more than one embedded protocols. In this case unanimity does not resolve 
selection alone and the order of preference needs to be respect and lead to 
deterministic selection. 
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Regression in handling of JoinGroupRequest disallows deterministic protocol 
> selection based on order of preference
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-8332
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8332
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>            Reporter: Konstantine Karantasis
>            Assignee: Konstantine Karantasis
>            Priority: Blocker
>
> When a group of Kafka clients includes more than one embedded protocol in its 
> {{JoinGroupRequest}} along with its metadata, the group membership protocol 
> defines that the protocol which is supported by all the members of a group is 
> selected, and if more than one protocols are supported by all the members the 
> protocol is selected based on the order of preference as defined in the 
> {{JoinGroupRequest}}. 
> A recent change from type {{List}} to type {{Set}} for storing the set of 
> supported embedded protocols in the {{JoinGroupRequest}} combined with the 
> old type of handling with implicit types in the scala code, has introduced 
> non-determinism in the selection of the embedded protocol by the 
> {{GroupCoordinator}}, even though the underlying type of the Set in use is a 
> variant of LinkedHashSet (it respects order). 
> The relevant code is: 
> {code:java}
> // KafkaApis.scala
> val protocols = joinGroupRequest.data().protocols().asScala.map(protocol =>
>       (protocol.name, protocol.metadata)).toList
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to