-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KAFKA-6328] Exclude node groups belonging to global stores in InternalTopologyBuilder#makeNodeGroups #4339
[KAFKA-6328] Exclude node groups belonging to global stores in InternalTopologyBuilder#makeNodeGroups #4339
Conversation
…alTopologyBuilder
…alTopologyBuilder#makeNodeGroups
Test failures seems related. Please update PR before we can review. |
The system tests failures are relevant. The NPE is because So on a second though, we cannot simply just skip building the group for global stores; instead we can consider using negative group ids for them (this is allowed as we return |
Oh, I used a boolean parameter instead to determine whether or not to keep the global node groups. I think that way we could also accomplish the same thing. |
I was looking at an older version of the PR with only the first commit. A boolean flag could also work but I think creating the node groups with negative index values on the key could also help simplifying the other logic a bit. WDYT? |
@guozhangwang Ok, I have simplified the logic a bit. |
|
||
if (!isNodeGroupOfGlobalStores) { | ||
describeSubtopology(description, nodeGroup.getKey(), allNodesOfGroups); | ||
} | ||
} | ||
} | ||
|
||
private boolean nodeGroupContainsGlobalSourceNode(final Set<String> allNodesOfGroups) { | ||
for (final String node : allNodesOfGroups) { | ||
if (isGlobalSource(node)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change other callers of isGlobalSource
and use the index instead? E.g. describeGlobalStores()
, and then this isGlobalSource
itself could be removed.
@ConcurrencyPractitioner could you try to run unit test locally before updating the PR? The command line is |
@guozhangwang I think I have spotted some inconsistency with using negative integers as indicating a node group to be a global node group. For starters, in the original code, the key used in |
What I could do is add an extra check specifically for the zero case to check if its global. On another note, I would like to point out that by this point, negative integers for keys does not seem to be any more simple than using only a boolean flag. From my understanding, your approach might as well be increasing the logic complexity involved, since it requires drastic changes with |
I see your point. Though the
On the other hand, my proposed solution would have a bad effect on So I'm wondering, if it would be a simpler change to just improve the |
@guozhangwang I think we could have a way to partition nodes into global and non global. Namely after all the nodes have been added, near the very end of |
@guozhangwang Will be on a vacation for a few days, so wouldn't be able to respond to your comments. Thanks! |
@ConcurrencyPractitioner The problem that I was pointing out, is that we need to keep compatibility in our mind: assume you are going to upgrade your streams app from 1.0.0 to 1.1.0 with this fix, and then task Happy holidays! We can chat later when you are back. |
Got it. I would just like to note that the keys which the node groups are mapped to are never changed. I am only rearranging the order in which the |
Typo above: I don't think sorting Map.Entrys would change the sub-topology ids in anyway. |
Is the current PR your final proposal? It seems only sorted the |
On one note, the partitioning above I think was intended to insure that global node groups come before non-global. On another note, this PR is not my final proposal. My intention was to present a partitioning not to improve on describe() but rather another attempt at what KAFKA-6328 was initially described to be (exclude node groups). But rather than excluding global node groups, I sort node groups into global and non-global to allow other methods which call |
…alTopologyBuilder Testing
…alTopologyBuilder Testing [KAFKA-6328] Exclude node groups belonging to global stores in InternalTopologyBuilder#makeNodeGroups Removing foolish recursion error Adding checks for global node groups Converted to negative partitions Adding sorting mechanism
Note that as of today, in
Note the global store display does not include the index, and hence they may not realize it is actually for group What I was thinking, that if we cannot exclude the global store from the ids in a compatible way, we can change the display in a way like:
this may help users understand the topology re-presentation better. |
Oh, I understand your point. I will see what I can do. |
Currently, in my last commit I have simplified |
Thanks! Your current commit looks promising. Please ping me again when you are finally done. |
@guozhangwang It appears that
The index number is not given, nor is it one of the fileds in
In this case, the id number is present. This might mean that your above suggestion to change |
Could we add the index id to |
@guozhangwang Ok, I have added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line 1243 of InternalTopologyBuilder
, in GlobalStore#toString()
, could we add the id as well?
LGTM. Edited on the commit message and minor updates on the description message before merging. Thanks. |
…ologyBuilder#makeNodeGroups Author: RichardYuSTUG <yohan.richard.yu2@gmail.com> Reviewers: Guozhang Wang <wangguoz@gmail.com> Closes #4339 from ConcurrencyPractitioner/kafka-6238 Minor edits on description
No description provided.