AndrewJSchofield commented on PR #23874:
URL: https://github.com/apache/kafka/pull/23874#issuecomment-6400650974
> Thanks for the review, @AndrewJSchofield. I've addressed both points:
>
> * Renamed the test to `testAssignWithUnsubscribedTopicHomogeneous`.
> * Added `testAssignWithUnsubscribedTopicHeterogeneous` as its
heterogeneous partner.
>
> For the heterogeneous test I used a slightly different scenario: member A
drops topic 2 while member B still subscribes to it. It checks that A's
partition of topic 2 is revoked and that B ends up with both partitions of
topic 2, while topic 1 is still spread two partitions per member.
>
> I didn't mirror the homogeneous scenario exactly (no member subscribes to
topic 2 anymore), because in the heterogeneous builder that case doesn't revoke
topic 2. While writing the test, I tried A subscribed to {T1} and B to {T1,
T3}, with both members still holding a partition of T2 in their current
assignment. The result was:
>
> ```
> A={T2=[0], T1=[0, 2]}
> B={T2=[1], T1=[1, 3], T3=[0, 1]}
> ```
>
> As far as I can tell, `SimpleHeterogeneousAssignmentBuilder#build` only
iterates over the union of the members' subscribed topics. A topic that nobody
subscribes to is never visited, so the members' old assignments for it are
carried over unchanged. For the same reason, the `else` branch in
`TopicAssignmentPartialBuilder#revokeUnassignablePartitions` that removes the
topic seems unreachable, since `topicId` is always in `subscribedTopicIds`
there.
>
> Is this the expected behaviour? If it's a bug, I'm happy to open a JIRA
and address it in a separate PR.
Yes, I think it's a bug.
--
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]