GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][client] Fix failover consumer-listener stuck with cumulative ack and epoch time by rdhabalia · Pull Request #23345 · apache/pulsar

Conversation

@rdhabalia

@rdhabalia rdhabalia commented Sep 24, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation

Currently, Pulsar-client lib doesn't increase the permits for partitioned/Multi-Topic consumer if MultiTopic-Consumer fails to validate the epoch time of the message. Because of that Pulsar Consumer stops receiving messages for the partition .

stats

subscriptions" : {
"activeConsumerName" : "f8051",
:
"consumers" : [ {
        "msgRateOut" : 0.0,
        "msgThroughputOut" : 0.0,
        "bytesOutCounter" : 3623009,
        "msgOutCounter" : 6752,
        "msgRateRedeliver" : 0.0,
        "messageAckRate" : 0.0,
        "chunkedMessageRate" : 0.0,
        "consumerName" : "f8051",
        "availablePermits" : -2,


stats-internal


cursors" : {
    "my-failover-sub" : {
      "markDeletePosition" : "4748166582:37897",
      "readPosition" : "4748166582:37898",


18:52:18.473 [pulsar-client-internal-1003-1] WARN  org.apache.pulsar.client.impl.ConsumerBase - Consumer filter old epoch message, topic : [persistent://myProp/ns1/t1], messageId : [4748166582:37897:23], messageConsumerEpoch : [4], consumerEpoch : [5]  yrid: 
18:52:18.476 [pulsar-client-internal-1003-1] DEBUG org.apache.pulsar.client.impl.MultiTopicsConsumerImpl - [persistent://myProp/ns1/t1][my-failover-sub] Received message from topics-consumer 4748166582:37897:23
18:52:18.823 [pulsar-external-listener-863-1] DEBUG org.apache.pulsar.client.impl.ConsumerBase - [persistent://myProp/ns1/t1][my-failover-sub] Calling message listener for message 4748166582:37897:23

Modifications

Pulsar consumer should increase permits if it discard messages due to epoch mismatch and continue processing messages with correct epoch.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rdhabalia rdhabalia added area/client doc-not-needed Your PR changes do not impact docs ready-to-test labels Sep 24, 2024
@rdhabalia rdhabalia self-assigned this Sep 24, 2024
@rdhabalia
rdhabalia force-pushed the consumer_epoch branch 2 times, most recently from 556974d to 2c88663 Compare September 24, 2024 22:43
@codecov-commenter

codecov-commenter commented Sep 25, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.49%. Comparing base (bbc6224) to head (c1334f0).
⚠️ Report is 1357 commits behind head on master.

Files with missing lines Patch % Lines
...va/org/apache/pulsar/client/impl/ConsumerImpl.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23345      +/-   ##
============================================
+ Coverage     73.57%   74.49%   +0.92%     
- Complexity    32624    33960    +1336     
============================================
  Files          1877     1934      +57     
  Lines        139502   145241    +5739     
  Branches      15299    15880     +581     
============================================
+ Hits         102638   108197    +5559     
+ Misses        28908    28720     -188     
- Partials       7956     8324     +368     
Flag Coverage Δ
inttests 27.70% <37.50%> (+3.12%) ⬆️
systests 24.48% <37.50%> (+0.15%) ⬆️
unittests 73.85% <75.00%> (+1.00%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...he/pulsar/client/impl/MultiTopicsConsumerImpl.java 77.99% <100.00%> (+0.26%) ⬆️
...va/org/apache/pulsar/client/impl/ConsumerImpl.java 79.42% <0.00%> (+1.85%) ⬆️

... and 607 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Technoboy-
Technoboy- reviewed Sep 26, 2024
View reviewed changes
Comment thread pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Technoboy-
Technoboy- reviewed Sep 26, 2024
View reviewed changes
Comment thread pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageRedeliveryTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@rdhabalia
rdhabalia force-pushed the consumer_epoch branch from 2c88663 to 9a74084 Compare September 26, 2024 06:00
vineeth1995
vineeth1995 approved these changes Sep 27, 2024
View reviewed changes
@rdhabalia
rdhabalia force-pushed the consumer_epoch branch 4 times, most recently from 7a0ff6f to a264c9d Compare September 28, 2024 09:42
@rdhabalia
[fix][client] Fix failover consumer-listener stuck with cumulative ac…
c1334f0
…k and epoch time

fix test
@rdhabalia
rdhabalia force-pushed the consumer_epoch branch from a264c9d to c1334f0 Compare October 1, 2024 22:56
@rdhabalia
rdhabalia merged commit 53e996c into apache:master Oct 2, 2024
@rdhabalia
rdhabalia deleted the consumer_epoch branch October 2, 2024 17:12
@lhotari lhotari added this to the 4.0.0 milestone Oct 14, 2024
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
@rdhabalia hanmz
[fix][client] Fix failover consumer-listener stuck with cumulative ac…
9fdfe02
…k and epoch time (apache#23345)
This was referenced Oct 31, 2026
[fix][client] Don't return pre-redeliver messages from a multi-topics consumer's receive() #27091
Closed
[fix][client] Don't return pre-redeliver messages from a multi-topics consumer's receive() #27301
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Technoboy- Technoboy- Technoboy- left review comments
@vineeth1995 vineeth1995 vineeth1995 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@rdhabalia rdhabalia

Labels

area/client doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Milestone

4.0.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@rdhabalia @codecov-commenter @Technoboy- @vineeth1995 @lhotari
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.