nizhikov commented on PR #16106:
URL: https://github.com/apache/kafka/pull/16106#issuecomment-2154948558

   Hello 
   
   @cmccabe 
   @AndrewJSchofield 
   @showuon 
   
   I struggle with the `DescribeQuorumRequestTest` - the test send request of 
all existing versions and check results.
   It's not clear on how I can handle specific request version when creating 
response:
   
   `DescribeQuorumResponse#singletonResponse` have no access to request version 
but `DescribeQuorumResponseData#write` check that nodes are not set for 
previous versions:
   
   ```
       @Override
       public void write(Writable _writable, ObjectSerializationCache _cache, 
short _version) {
   ...
           if (_version >= 2) {
               _writable.writeUnsignedVarint(nodes.size() + 1);
               for (Node nodesElement : nodes) {
                   nodesElement.write(_writable, _cache, _version);
               }
           } else {
               if (!this.nodes.isEmpty()) {
                   throw new UnsupportedVersionException("Attempted to write a 
non-default nodes at version " + _version); // Test fails here.
               }
           }
   ```
   
   Can you, please, show me an example - how previous request versions must be 
handled?


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to