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

[improve][broker] Optimize Consumer.individualAck to avoid multiple call pendingAck to find acked consumer. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lifepuzzlefun
Copy link
Owner

@lifepuzzlefun lifepuzzlefun commented Oct 11, 2023

Motivation

Current broker logic of individualAck will try to locate position and which consumer is the acked message owner.

but the logic is not shared the information which will call this find logic multiple times.

eg. foreach ack messge:

  1. getBatchSize will call find logic.
  2. ack logic call find logic.
  3. checkCanRemovePendingAcksAndHandle will call find logic.
  4. removePendingAck will call find logic.

if the message is own by other consumers, and if consumer within one subscription is huge the performance is very low.

Modifications

just call one time find logic. and return the origin LongPair to extract information.
when the following logic try to use the pos and owner information. just pass the find owner consumer.

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:

@lifepuzzlefun lifepuzzlefun changed the title optimize consumer individual ack to avoid multiple call logic to find… [improve][broker] optimize consumer individual ack to avoid multiple call logic to find… Oct 11, 2023
@lifepuzzlefun lifepuzzlefun changed the title [improve][broker] optimize consumer individual ack to avoid multiple call logic to find… [improve][broker] Optimize Consumer.individualAck to avoid multiple call pendingAck to find acked consumer. Oct 11, 2023
Copy link

The pr had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants