lucasbru opened a new pull request, #20730:
URL: https://github.com/apache/kafka/pull/20730

   This PR implements assignment epoch tracking for streams groups.
   
   Fundamentally, this replaces the representation of current assignments and 
pending revocations from Map<String, Set<Integer>> to Map<String, Map<Integer, 
Integer>> where the
   value of the inner map is the assignment epoch. Target assignments, and the 
tasks reported
   as currently owned, still use the former representation, since they do not 
include assignment epochs. This change only applies to active tasks. From 
`TasksTuple`, we create `TasksTupleWithEpochs`, which carries the assignment 
epochs.
   
   The core of the change is in `CurrentAssignmentBuilder`, which takes the 
previous assignment epochs from `assignedTasks` and `tasksPendingRevocation` 
and applies them to all tasks in the new assignment. If a task in the new 
assignment was not previously assigned, it gets the targetAssignmentEpoch, that 
the member transitions to.
   
   There are a lot of mechanic follow-up changes to use `TasksTupleWithEpochs` 
in-place of `TasksTuple`. In general, I tried to follow the following strategy 
when adapting existing tests:
    - When assignment epochs do no play a role in a test, we instantiate all 
tasks with the same assignments epoch using TestAssignmentUtils.
    - The main tests for correctly updating the assignment epoch are in 
`CurrentAssignmentBuilderTest`.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to