Skip to content

[fix][broker] Resolve the issue of frequent updates in message expiration deletion rate - #24190

Merged
nodece merged 5 commits into
apache:masterfrom
zjxxzjwang:master-Optimization-of-message-expiration-rate
May 23, 2025
Merged

nodece merged 5 commits into
apache:masterfrom
zjxxzjwang:master-Optimization-of-message-expiration-rate

Conversation

@zjxxzjwang

@zjxxzjwang zjxxzjwang commented Apr 21, 2025 •

Copy link
Copy Markdown
Contributor

Motivation

Modifications

At present, the message expiration deletion rate is updated in the getmessageExpiryRate() method, and this rate is updated every time the topic status is obtained. This results in the statistical analysis of message expiration and deletion rates not having a fixed periodicity, making it difficult to represent the true message expiration rate.

Documentation

Only update the rate in the updateRate() method and only retrieve the value in the getmessageExpiryRate() method

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

Matching PR in forked repository

PR in forked repository:

@github-actions

Copy link
Copy Markdown

@zjxxzjwang Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@zjxxzjwang
zjxxzjwang requested a review from nodece April 24, 2025 03:26

@nodece nodece left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@nodece
nodece requested review from dao-jun and lhotari April 25, 2025 05:03
@jiazhai

jiazhai commented Apr 28, 2025

Copy link
Copy Markdown
Member

This is similar to PR #19759, but not sure how it was reverted

@jiazhai

jiazhai commented Apr 28, 2025

Copy link
Copy Markdown
Member

Get the reverting information: #24073

@jiazhai

jiazhai commented Apr 28, 2025

Copy link
Copy Markdown
Member

@zjxxzjwang Would you please help add a unit test for this change following PR #19759. Seems this part of code is easy to be broken, it is better to protect it.

@zjxxzjwang

Copy link
Copy Markdown
Contributor Author

@zjxxzjwang Would you please help add a unit test for this change following PR #19759. Seems this part of code is easy to be broken, it is better to protect it.

Good suggestion, I have also considered it before. But it seems that there are no good test examples to determine if this has not been broken.

@zjxxzjwang

Copy link
Copy Markdown
Contributor Author

@lhotari Hello, can you review it

@nodece

nodece commented May 8, 2025

Copy link
Copy Markdown
Member

@zjxxzjwang Please rebase the master branch, and then I will merge this PR after CI passes.

@HQebupt

HQebupt commented May 22, 2025

Copy link
Copy Markdown
Contributor

/pulsarbot rerun-failure-checks

@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels May 22, 2025
@github-actions github-actions Bot added the PIP label May 22, 2025
@zjxxzjwang

Copy link
Copy Markdown
Contributor Author

@zjxxzjwang Please rebase the master branch, and then I will merge this PR after CI passes.

hello , I have rebased the master branch and added test cases. Can you help me merge it

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 79.88879% with 217 lines in your changes missing coverage. Please review.

Project coverage is 74.27%. Comparing base (bbc6224) to head (b94f50f).
Report is 1116 commits behind head on master.

Files with missing lines Patch % Lines
...rg/apache/pulsar/broker/service/HealthChecker.java 73.71% 37 Missing and 4 partials ⚠️
.../java/org/apache/pulsar/client/impl/ClientCnx.java 10.52% 22 Missing and 12 partials ⚠️
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 51.72% 19 Missing and 9 partials ⚠️
...va/org/apache/pulsar/client/impl/ProducerImpl.java 78.82% 12 Missing and 6 partials ⚠️
...sar/broker/service/persistent/PersistentTopic.java 79.72% 12 Missing and 3 partials ⚠️
...n/java/org/apache/pulsar/broker/PulsarService.java 87.25% 8 Missing and 5 partials ⚠️
...g/apache/pulsar/PulsarClusterMetadataTeardown.java 0.00% 8 Missing ⚠️
.../service/SystemTopicBasedTopicPoliciesService.java 78.12% 6 Missing and 1 partial ⚠️
...a/org/apache/pulsar/broker/service/Dispatcher.java 0.00% 6 Missing ⚠️
.../org/apache/pulsar/broker/admin/AdminResource.java 90.38% 1 Missing and 4 partials ⚠️
... and 19 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24190      +/-   ##
============================================
+ Coverage     73.57%   74.27%   +0.69%     
+ Complexity    32624    32265     -359     
============================================
  Files          1877     1866      -11     
  Lines        139502   145125    +5623     
  Branches      15299    16593    +1294     
============================================
+ Hits         102638   107788    +5150     
+ Misses        28908    28826      -82     
- Partials       7956     8511     +555     
Flag Coverage Δ
inttests 26.96% <37.25%> (+2.37%) ⬆️
systests 23.30% <20.01%> (-1.02%) ⬇️
unittests 73.75% <79.70%> (+0.90%) ⬆️

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

Files with missing lines Coverage Δ
...a/org/apache/bookkeeper/mledger/ManagedLedger.java 0.00% <ø> (ø)
...rg/apache/bookkeeper/mledger/impl/AckSetState.java 100.00% <ø> (ø)
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 78.68% <100.00%> (-0.62%) ⬇️
...thentication/oidc/OpenIDProviderMetadataCache.java 78.75% <ø> (+0.26%) ⬆️
...areness/IsolatedBookieEnsemblePlacementPolicy.java 87.21% <100.00%> (+0.19%) ⬆️
...org/apache/pulsar/broker/ServiceConfiguration.java 98.16% <100.00%> (-1.24%) ⬇️
...pache/pulsar/broker/admin/impl/NamespacesBase.java 76.09% <100.00%> (+3.01%) ⬆️
...pulsar/broker/admin/impl/PersistentTopicsBase.java 70.15% <100.00%> (+4.70%) ⬆️
...g/apache/pulsar/broker/admin/impl/TenantsBase.java 89.38% <100.00%> (-7.07%) ⬇️
...rg/apache/pulsar/broker/admin/v3/Transactions.java 69.17% <ø> (-6.85%) ⬇️
... and 84 more

... and 998 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.

@nodece nodece changed the title [improve][broker]Resolve the issue of frequent updates in message expiration deletion rate [fix][broker] Resolve the issue of frequent updates in message expiration deletion rate May 23, 2025
@nodece
nodece merged commit 81c94c8 into apache:master May 23, 2025

@hanmz hanmz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

lhotari pushed a commit that referenced this pull request Jun 2, 2025
…tion deletion rate (#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
lhotari pushed a commit that referenced this pull request Jun 2, 2025
…tion deletion rate (#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
lhotari pushed a commit that referenced this pull request Jun 2, 2025
…tion deletion rate (#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit ef5c829)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit 071dacf)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit ef5c829)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 4, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit ef5c829)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 5, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit 071dacf)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 5, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit ef5c829)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 10, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
(cherry picked from commit ef5c829)
nodece pushed a commit to nodece/pulsar that referenced this pull request Jun 18, 2025
…tion deletion rate (apache#24190)

Co-authored-by: zjxxzjwang <[email protected]>
(cherry picked from commit 81c94c8)
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
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.

8 participants