diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-08-20 16:34:51 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-08-20 16:35:12 -0700 |
commit | e50d4dde3c2634fc33168a869314e91769573dd4 (patch) | |
tree | 69af4a3ebbbc4772a47d84ecef4ebe424bba0efe | |
parent | e5c64874b4692a6c1b7193691656f88954709a0d (diff) | |
download | kafka-python-e50d4dde3c2634fc33168a869314e91769573dd4.tar.gz |
Add comment for round robin partitioner with different subscriptions
-rw-r--r-- | kafka/coordinator/assignors/roundrobin.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kafka/coordinator/assignors/roundrobin.py b/kafka/coordinator/assignors/roundrobin.py index a068b3f..c241685 100644 --- a/kafka/coordinator/assignors/roundrobin.py +++ b/kafka/coordinator/assignors/roundrobin.py @@ -29,6 +29,21 @@ class RoundRobinPartitionAssignor(AbstractPartitionAssignor): The assignment will be: C0: [t0p0, t0p2, t1p1] C1: [t0p1, t1p0, t1p2] + + When subscriptions differ across consumer instances, the assignment process + still considers each consumer instance in round robin fashion but skips + over an instance if it is not subscribed to the topic. Unlike the case when + subscriptions are identical, this can result in imbalanced assignments. + + For example, suppose we have three consumers C0, C1, C2, and three topics + t0, t1, t2, with unbalanced partitions t0p0, t1p0, t1p1, t2p0, t2p1, t2p2, + where C0 is subscribed to t0; C1 is subscribed to t0, t1; and C2 is + subscribed to t0, t1, t2. + + The assignment will be: + C0: [t0p0] + C1: [t1p0] + C2: [t1p1, t2p0, t2p1, t2p2] """ name = 'roundrobin' version = 0 |