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

[FIXED] When scaling down a stream make sure consumers are adjusted properly. #5927

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

derekcollison
Copy link
Member

When scaling down a stream make sure replica count is correct if adjusted and also make sure we do not have orphan consumers.

When we scale down a replicated stream, say R5, if it has consumers that are a lower replica count, say R1, they could be placed on the peers that may go away. We need to make sure we properly assign peers and transfer state as needed.

Note the consumer state transfer expects the state to be stable, so should be paused.

Signed-off-by: Derek Collison [email protected]

…sted and also make sure we do not have orphan consumers.

When we scale down a replicated stream, say R5, if it has consumers that are a lower replica count, say R1, they could be placed on the peers that may go away. We need to make sure we properly assign peers and transfer state as needed.

Note the consumer state transfer expects the state to be stable, so should be paused.

Signed-off-by: Derek Collison <[email protected]>
@derekcollison derekcollison requested a review from a team as a code owner September 25, 2024 15:51
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

Just one question but otherwise LGTM.

s.Warnf("Did not receive consumer info results for '%s > %s > %s' due to: %s", acc, osa.Config.Name, ca.Name, err)
} else if ci != nil {
cca.State = &ConsumerState{
Delivered: SequencePair{
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to include the Redelivered state here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do not have access to that state here.

Copy link
Member Author

Choose a reason for hiding this comment

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

So not perfect, and we should revisit for 2.11, but better then what we had for sure.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good.

@derekcollison derekcollison merged commit 4c21aa3 into main Sep 25, 2024
4 of 5 checks passed
@derekcollison derekcollison deleted the scale-down-orphans branch September 25, 2024 16:11
neilalexander added a commit that referenced this pull request Sep 25, 2024
Includes:

- #5925
- #5926
- #5927

Signed-off-by: Neil Twigg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants