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

Prevent message-replay of already acknowledged messages #38

Merged
merged 1 commit into from Sep 26, 2016

Conversation

rdhabalia
Copy link
Contributor

Motivation

In Race condition of: (1) message-redelivery-request and (2) ack-message: broker tries to replay already acked messages which results into invalid entry while replaying it and it keeps retrying reading of same entry.
Right now, It happens only when consumer has already consumed all publish messages and broker receives redelivery of unack message request.

Modifications

  • filter out already acked messages before replaying it.
  • remove already acked message from messageReplay bucket

Result

Broker will ignore already acked message while replaying it.

@yahoocla
Copy link

CLA is valid!

@merlimat merlimat added this to the 1.15 milestone Sep 26, 2016
@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Sep 26, 2016
@merlimat merlimat merged commit d7d5163 into apache:master Sep 26, 2016
// filters out messages which are already acknowledged
Set<Position> alreadyAcknowledgedPositions = Sets.newHashSet();
positions.stream().filter(position -> {
return individualDeletedMessages.contains((PositionImpl) position)
Copy link
Contributor

Choose a reason for hiding this comment

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

any access to the individualDeletedMessages should be from within a r/w lock

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.. i created PR to fix it.

@rdhabalia rdhabalia deleted the replay branch November 11, 2016 23:03
sijie pushed a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
* Create pulsar-functions module (#1)

* Create pulsar-functions module

* rename `sdk` package to `api`

* Added the first cut of the Java interface for Pulsar functions (#2)

* In case of Kstream style running, we dont need to spawn a executor service to run the message

* Update comment
massakam pushed a commit to massakam/pulsar that referenced this pull request Aug 6, 2020
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
Fix CI the openjdk-8-jre-headless can't download
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants