Skip to content
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

Allow BalanceStrategy to provide custom assignment data #1592

Merged
merged 3 commits into from
Feb 4, 2020

Conversation

aldelucca1
Copy link
Contributor

The StickyBalanceStrategy currently provides state information with member assignments. This is achieved through a custom name check in the syncGroupRequest of the consumer group. This works well for this case, but falls apart when trying to create additional stateful balance strategies. This update will make it possible to create new stateful balance strategies

The StickyBalanceStrategy currently provides state information with member assignments. This is achieved through a custom name check in the `syncGroupRequest` of the consumer group. This works well for this case, but falls apart when trying to create additional stateful balance strategies. This update will make it possible to create new stateful balance strategies
@aldelucca1 aldelucca1 requested a review from bai as a code owner January 30, 2020 14:56
@ghost ghost added the cla-needed label Jan 30, 2020
@ghost ghost removed the cla-needed label Jan 30, 2020
Copy link
Contributor

@d1egoaz d1egoaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aldelucca1

I've added one question.

Would be possible somehow to add a test for this in balance_strategy_test.go?

return nil, err
}
assignment.UserData = userDataBytes
userDataBytes, err := strategy.AssignmentData(plan, memberID, generationID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering why you'd need to send the plan and member to AssignmentData to get the topics:

	topics, ok := plan[memberID]
	if !ok {
		return nil, nil
	}

if that was already obtained in the range above?
Line 335 for memberID, topics := range plan

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking here was in the case the state being shipped needed to understand data about the larger plan, but I am happy limiting the scope to just the given member and its assigned topics.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fast response!
I'll 👀 later today

Copy link
Contributor

@d1egoaz d1egoaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@bai could you please take another look at this?
Thanks

@d1egoaz d1egoaz mentioned this pull request Feb 4, 2020
@bai bai merged commit 304d196 into IBM:master Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants