You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2020/06/03 03:43:04 UTC
[kafka] branch 2.6 updated: KAFKA-10083: fix failed
testReassignmentWithRandomSubscriptionsAndChanges tests (#8786)
This is an automated email from the ASF dual-hosted git repository.
guozhang pushed a commit to branch 2.6
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.6 by this push:
new b7166aa KAFKA-10083: fix failed testReassignmentWithRandomSubscriptionsAndChanges tests (#8786)
b7166aa is described below
commit b7166aa507ae1c0e3a5235055a0732fbbefa2985
Author: A. Sophie Blee-Goldman <so...@confluent.io>
AuthorDate: Tue Jun 2 20:39:02 2020 -0700
KAFKA-10083: fix failed testReassignmentWithRandomSubscriptionsAndChanges tests (#8786)
Minimum fix needed to stop this test failing and unblock others
Co-authored-by: Luke Chen <sh...@gmail.com>
Reviewers: Guozhang Wang <wa...@gmail.com>
---
.../kafka/clients/consumer/internals/AbstractStickyAssignor.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
index 9743688..a1af6d9 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
@@ -43,7 +43,7 @@ public abstract class AbstractStickyAssignor extends AbstractPartitionAssignor {
public static final int DEFAULT_GENERATION = -1;
- private PartitionMovements partitionMovements = new PartitionMovements();
+ private PartitionMovements partitionMovements;
// Keep track of the partitions being migrated from one consumer to another during assignment
// so the cooperative assignor can adjust the assignment
@@ -72,6 +72,7 @@ public abstract class AbstractStickyAssignor extends AbstractPartitionAssignor {
@Override
public Map<String, List<TopicPartition>> assign(Map<String, Integer> partitionsPerTopic,
Map<String, Subscription> subscriptions) {
+ partitionMovements = new PartitionMovements();
Map<String, List<TopicPartition>> consumerToOwnedPartitions = new HashMap<>();
if (allSubscriptionsEqual(partitionsPerTopic.keySet(), subscriptions, consumerToOwnedPartitions)) {
log.debug("Detected that all consumers were subscribed to same set of topics, invoking the "