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] Avoid repeated Read-and-discard when using Key_Shared mode #22245

Merged

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Mar 11, 2024

Motivation

When using Key_Shared subscription, the broker may discard a part of the result reading from BK to avoid breaking the order of consumption, but this may cause repeated Read-and-discard, which wastes a lot of BK traffic.

  • Read entries from the Replay queue.
  • The entries can not be sent to the consumer due to they are larger than consumer.maxReadPosition
  • Nothing was delivered to the client, but the Broker did more and more BK readings.

You can reproduce the issue by testNoRepeatedReadAndDiscard

Modifications

Before reading the BK, filter out the positions that will be discarded.

Documentation

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

Matching PR in forked repository

PR in forked repository: x

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Mar 11, 2024
@poorbarcode poorbarcode self-assigned this Mar 11, 2024
@poorbarcode poorbarcode added this to the 3.3.0 milestone Mar 11, 2024
@poorbarcode poorbarcode reopened this Mar 11, 2024
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.

Please check the KeySharedSubscriptionTest failures that are in the flaky test suite.

@poorbarcode
Copy link
Contributor Author

@lhotari

Please check the KeySharedSubscriptionTest failures in the flaky test suite.

Fixed, thanks

@poorbarcode poorbarcode force-pushed the fix/repeat_read_in_key_shared_mode branch from 4f5a284 to 326c0cc Compare March 25, 2024 15:00
@poorbarcode
Copy link
Contributor Author

rebase master

@poorbarcode
Copy link
Contributor Author

rebase master

@codelipenghui codelipenghui merged commit e34ea62 into apache:master Mar 29, 2024
49 of 50 checks passed
poorbarcode added a commit that referenced this pull request Mar 29, 2024
poorbarcode added a commit that referenced this pull request Mar 29, 2024
poorbarcode added a commit that referenced this pull request Mar 29, 2024
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Apr 1, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 15, 2024
…red mode (apache#22245)

(cherry picked from commit e34ea62)
(cherry picked from commit 5b37e84)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…red mode (apache#22245)

(cherry picked from commit e34ea62)
(cherry picked from commit 5b37e84)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…red mode (apache#22245)

(cherry picked from commit e34ea62)
(cherry picked from commit 5b37e84)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 19, 2024
…red mode (apache#22245)

(cherry picked from commit e34ea62)
(cherry picked from commit 5b37e84)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2024
…red mode (apache#22245)

(cherry picked from commit e34ea62)
(cherry picked from commit 5b37e84)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants