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

Fix to stop forwarding proposals in consumers after scaling down a stream #4556

Merged
merged 4 commits into from Sep 18, 2023

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Sep 18, 2023

Sometimes when scaling down a stream, a raft node could continue forwarding proposals after already being closed, in the debug logs this can be confirmed by many entries logging Direct proposal ignored, not leader (state: CLOSED).

wallyqs and others added 2 commits September 18, 2023 12:26
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
…sals go routine

Signed-off-by: Derek Collison <derek@nats.io>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM - How long does test take?

@wallyqs
Copy link
Member Author

wallyqs commented Sep 18, 2023

Currently it takes about 40s, I think it can be made shorter

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.

Otherwise LGTM

defer o.mu.Unlock()
if o.qch != nil {
close(o.qch)
// Note can not close pch here.
Copy link
Member

Choose a reason for hiding this comment

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

Is this because of a panic when writing to the channel elsewhere?

server/jetstream_cluster.go Outdated Show resolved Hide resolved
@wallyqs wallyqs changed the title Fix to stop forwarding proposals after scaling a consumer down Fix to stop forwarding proposals in consumers after scaling down a stream Sep 18, 2023
wallyqs and others added 2 commits September 18, 2023 12:46
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
Signed-off-by: Derek Collison <derek@nats.io>
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.

LGTM

@wallyqs wallyqs merged commit 2d23e9b into main Sep 18, 2023
2 checks passed
@wallyqs wallyqs deleted the stream-scaling-issue branch September 18, 2023 20:51
wallyqs added a commit that referenced this pull request Oct 11, 2023
Backports the following PRs from v2.10:

- #4510 
- #4556 
- #4578 
- #4605 

Signed-off-by: Your Name <wally@nats.io>
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.

None yet

3 participants