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

KeyShared stickyHashRange subscription: prevent stuck subscription in case of consumer restart #14014

Merged
merged 1 commit into from Jan 29, 2022

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented Jan 28, 2022

Motivation

When using KeyShared subscription with stickyHashRange it is possible to a stuck subscription while restarting the consumers.

This bug is not a regression in 2.10, the problem is present also in Pulsar 2.8 (and probably older versions)

Modifications

add the entry to the list of messaged to be redelivered

Verifying this change

this patch adds a test that cover the change

Documentation

  • no-need-doc

@eolivelli eolivelli requested review from codelipenghui and lhotari and removed request for codelipenghui January 28, 2022 14:48
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 28, 2022
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Good work @eolivelli !

@eolivelli
Copy link
Contributor Author

Actually @codelipenghui helped me in finding out the problem and suggesting the fix

@eolivelli eolivelli added this to the 2.10.0 milestone Jan 28, 2022
Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

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

Great work. 👍🏼

@lhotari
Copy link
Member

lhotari commented Jan 28, 2022

Actually @codelipenghui helped me in finding out the problem and suggesting the fix

Thank you @codelipenghui for helping out!

@merlimat
Copy link
Contributor

prevent message loss

Messages are not lost, since they're still tracked in backlog. It's just stuck.

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Jan 28, 2022
@eolivelli
Copy link
Contributor Author

Messages are not lost, since they're still tracked in backlog. It's just stuck.

This is correct, for instance you can read them from another partition or you can reset the subscription to an earlier offset.

@eolivelli eolivelli changed the title KeyShared stickyHashRange subscription: prevent message loss in case of consumer restart KeyShared stickyHashRange subscription: prevent stuck subscription in case of consumer restart Jan 28, 2022
@eolivelli
Copy link
Contributor Author

@merlimat I updated the title

@merlimat
Copy link
Contributor

or you can reset the subscription to an earlier offset.

You'd just need to reconnect your consumers (eg: unload the topic) to get them unblocked.

@codelipenghui codelipenghui merged commit da9e806 into apache:master Jan 29, 2022
codelipenghui pushed a commit that referenced this pull request Jan 30, 2022
… case of consumer restart (#14014)

### Motivation
When using KeyShared subscription with `stickyHashRange` it is possible to a stuck subscription while restarting the consumers.

This bug is not a regression in 2.10, the problem is present also in Pulsar 2.8 (and probably older versions)

### Modifications

add the entry to the list of messaged to be redelivered

(cherry picked from commit da9e806)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jan 30, 2022
zymap pushed a commit that referenced this pull request Jan 30, 2022
… case of consumer restart (#14014)

When using KeyShared subscription with `stickyHashRange` it is possible to a stuck subscription while restarting the consumers.

This bug is not a regression in 2.10, the problem is present also in Pulsar 2.8 (and probably older versions)

add the entry to the list of messaged to be redelivered

(cherry picked from commit da9e806)
@zymap zymap added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jan 30, 2022
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
… case of consumer restart (apache#14014)

### Motivation
When using KeyShared subscription with `stickyHashRange` it is possible to a stuck subscription while restarting the consumers.

This bug is not a regression in 2.10, the problem is present also in Pulsar 2.8 (and probably older versions)

### Modifications

add the entry to the list of messaged to be redelivered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.3 release/2.9.2 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants