kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-2913: missing partition check when removing groups from cache
Date Tue, 01 Dec 2015 05:33:40 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 6b4cc2ea2 -> eafc349a1


KAFKA-2913: missing partition check when removing groups from cache

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Guozhang Wang

Closes #605 from hachikuji/KAFKA-2913


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/eafc349a
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/eafc349a
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/eafc349a

Branch: refs/heads/trunk
Commit: eafc349a1f26a20086b320916c2c819e05bc77ea
Parents: 6b4cc2e
Author: Jason Gustafson <jason@confluent.io>
Authored: Mon Nov 30 21:33:31 2015 -0800
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Mon Nov 30 21:33:31 2015 -0800

----------------------------------------------------------------------
 .../main/scala/kafka/coordinator/GroupMetadataManager.scala  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/eafc349a/core/src/main/scala/kafka/coordinator/GroupMetadataManager.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/coordinator/GroupMetadataManager.scala b/core/src/main/scala/kafka/coordinator/GroupMetadataManager.scala
index 167267f..f2ffa50 100644
--- a/core/src/main/scala/kafka/coordinator/GroupMetadataManager.scala
+++ b/core/src/main/scala/kafka/coordinator/GroupMetadataManager.scala
@@ -489,9 +489,11 @@ class GroupMetadataManager(val brokerId: Int,
 
         // clear the groups for this partition in the cache
         for (group <- groupsCache.values) {
-          onGroupUnloaded(group)
-          groupsCache.remove(group.groupId, group)
-          numGroupsRemoved += 1
+          if (partitionFor(group.groupId) == offsetsPartition) {
+            onGroupUnloaded(group)
+            groupsCache.remove(group.groupId, group)
+            numGroupsRemoved += 1
+          }
         }
       }
 


Mime
View raw message