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

[fix][broker] Increment topic stats outbound message counters and update rate after messages have been written to the TCP/IP connection #17043

Merged
merged 1 commit into from Aug 11, 2022

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Aug 10, 2022

Motivation

  • counters could get off a lot when many consumers are reconnecting from time to time

Additional context

Pulsar increments the counters when the sending is scheduled. Since the dispatching code is asynchronous, it behaves in a way that Pulsar will try to consume all permits and queue as much of messages as possible. Since the counters are incremented before the messages have been written to the TCP/IP socket, this will result in the counters getting out of sync when the connection is disconnected.

Modifications

  • increment counters and update rate after the messages have been successfully written to the TCP/IP connection
  • doc-not-needed

…essages have been written to the TCP/IP connection

- counters could get off a lot when a large number of consumers are reconnecting
@lhotari lhotari added the doc-not-needed Your PR changes do not impact docs label Aug 10, 2022
@lhotari lhotari self-assigned this Aug 10, 2022
@codelipenghui codelipenghui added this to the 2.12.0 milestone Aug 11, 2022
@codelipenghui codelipenghui merged commit 2bc933e into apache:master Aug 11, 2022
@Technoboy- Technoboy- modified the milestones: 2.12.0, 2.11.0 Aug 11, 2022
Technoboy- pushed a commit that referenced this pull request Aug 11, 2022
…essages have been written to the TCP/IP connection (#17043)
coderzc pushed a commit to coderzc/pulsar that referenced this pull request Aug 13, 2022
…essages have been written to the TCP/IP connection (apache#17043)
Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

Nice change, LGTM.

Technoboy- pushed a commit to merlimat/pulsar that referenced this pull request Aug 16, 2022
…essages have been written to the TCP/IP connection (apache#17043)
@mattisonchao
Copy link
Member

Hi @lhotari
Would you like to help cherry-pick this PR to branch-2.9?

Jason918 pushed a commit that referenced this pull request Sep 4, 2022
…essages have been written to the TCP/IP connection (#17043)

(cherry picked from commit 2bc933e)
lhotari added a commit to datastax/pulsar that referenced this pull request Sep 5, 2022
…essages have been written to the TCP/IP connection (apache#17043)

(cherry picked from commit 2bc933e)
congbobo184 pushed a commit that referenced this pull request Nov 11, 2022
…essages have been written to the TCP/IP connection (#17043)

(cherry picked from commit 2bc933e)
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 11, 2022
congbobo184 pushed a commit that referenced this pull request Dec 7, 2022
…essages have been written to the TCP/IP connection (#17043)

(cherry picked from commit 2bc933e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 cherry-picked/branch-2.11 doc-not-needed Your PR changes do not impact docs release/2.9.4 release/2.10.2 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

7 participants