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 — [Bug] Consumers getting stuck since read more entries doesn't properly handle retries with backoff · Issue #23264 · apache/pulsar

[Bug] Consumers getting stuck since read more entries doesn't properly handle retries with backoff #23264

New issue
Copy link
New issue
Copy link
Closed
Closed
[Bug] Consumers getting stuck since read more entries doesn't properly handle retries with backoff#23264
Copy link
Labels
category/reliabilityThe function does not work properly in certain specific environments or failures. e.g. data losttype/bugThe PR fixed a bug or issue reported a bug

Description

@lhotari
lhotari
opened on Sep 6, 2024
Issue body actions

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

all release versions

Minimal reproduce step

No steps to reproduce yet. This is based on reading the code and is more of a concern that a proven bug.

What did you expect to see?

Consumers shouldn't get stuck in complex scenarios where a trigger to read more gets ignored due to some other rule.

What did you see instead?

In dispatchers, the way how readMoreEntries is handled is not consistent.
It is very likely that a consumer will stop reading more entries and dispatching entries to a consumer when it would be necessary to do so. The reason for this is that there isn't proper tracking for the "signals" that trigger reading more and whether the signal is being handled. Now there are multiple flags and ways to prevent multiple reads in flight at once. This needs a refactoring to ensure that the behavior is consistent and reliable.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. lhotari
    added
    type/bugThe PR fixed a bug or issue reported a bug
    category/reliabilityThe function does not work properly in certain specific environments or failures. e.g. data lost
    on Sep 6, 2024
  2. lhotari commented on Sep 6, 2024

    @lhotari
    lhotari
    on Sep 6, 2024
    MemberAuthor
    More actions

    There's so many triggers for resuming to read more entries. One of many triggers:

    pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java

    Lines 507 to 521 in 1439529

    @Override
    public void markDeletePositionMoveForward() {
    // Execute the notification in different thread to avoid a mutex chain here
    // from the delete operation that was completed
    topic.getBrokerService().getTopicOrderedExecutor().execute(() -> {
    synchronized (PersistentStickyKeyDispatcherMultipleConsumers.this) {
    if (recentlyJoinedConsumers != null && !recentlyJoinedConsumers.isEmpty()
    && removeConsumersFromRecentJoinedConsumers()) {
    // After we process acks, we need to check whether the mark-delete position was advanced and we
    // can finally read more messages. It's safe to call readMoreEntries() multiple times.
    readMoreEntries();
    }
    }
    });
    }

  3. lhotari
    added this to Apache Pulsar / Key_Shared and Acknowledgement reliability and usability improvementson Sep 10, 2024
  4. lhotari commented on Oct 14, 2024

    @lhotari
    lhotari
    on Oct 14, 2024
    MemberAuthor
    More actions

    Addressed in #23231 and PIP-379 changes for Key_Shared.

  5. lhotari
    closed this as completedon Oct 14, 2024
  6. github-project-automation
    moved this from In Progress to Done in Apache Pulsar / Key_Shared and Acknowledgement reliability and usability improvementson Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/reliabilityThe function does not work properly in certain specific environments or failures. e.g. data losttype/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    • Apache Pulsar / Key_Shared and Acknowledgement reliability and usability improvements
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.