flashmouse commented on PR #13920:
URL: https://github.com/apache/kafka/pull/13920#issuecomment-1610578143

   @kirktrue thank you for reply!
   
   In your case, although ``isBalanced``  return false, 
``performReassignments`` still won't reassign any partition, because it would 
only do reassign when ``currentAssignment.get(consumer).size() > 
currentAssignment.get(otherConsumer).size() + 1``, it will just loop all 
partitions in reassignable list and find no one match it so ``modified`` keep 
``false`` then return done.
   
   I think the problem is ``isBalanced`` and ``performReassignments`` should 
have the same predict logic when they judge whether should do reassign. for now 
 ``performReassignments`` itself think should do reassign only when 2 consumers 
that their partition num gap should have at least 2 but  ``isBalanced`` is 1. 
   
   I mean with such situation, I think if we not modify ``isBalanced``,  the 
reassignment logic is still right, but may very slow.    
``performReassignments`` will do quite a lot unnecessary work, as I said above, 
it could done finally but cost a long time. you can try unit test 
``testLargeAssignmentAndGroupWithNonEqualSubscription`` without this pr change, 
if set ``partitionCount``= 20, ``consumerCount`` = 2, it could done with 
success, but if set ``partitionCount``= 200, ``consumerCount`` = 20, it may run 
very long time. I have run the test and no result after 14min, and it could 
speed up to 47sec after I apply my change.


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