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] Decouple pulsar_storage_backlog_age_seconds metric with backlogQuota check #23619

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

shibd
Copy link
Member

@shibd shibd commented Nov 21, 2024

Motivation

#21709 introduced a valuable metric: pulsar_storage_backlog_age_seconds, but it only updates when a topic has the message_age backlog quota policy.

Modifications

  • Decouple pulsar_storage_backlog_age_seconds metric from backlogQuota policy
  • For now, the backlogQuotaChecker is also used to periodically update the pulsar_storage_backlog_age_seconds metric, regardless of whether the topic has a backlog quota policy.

Verifying this change

  • Add backlogsAgeMetricsNoPreciseWithoutBacklogQuota and backlogsAgeMetricsPreciseWithoutBacklogQuota to cover this change.

Documentation

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

Matching PR in forked repository

PR in forked repository:

@shibd shibd added type/refactor Code or documentation refactors. e.g. refactor code structure or methods to improve code readability ready-to-test labels Nov 21, 2024
@shibd shibd self-assigned this Nov 21, 2024
@github-actions github-actions bot added doc-label-missing doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Nov 21, 2024
@apache apache deleted a comment from github-actions bot Nov 21, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 81.01266% with 15 lines in your changes missing coverage. Please review.

Project coverage is 74.35%. Comparing base (bbc6224) to head (44db547).
Report is 780 commits behind head on master.

Files with missing lines Patch % Lines
...sar/broker/service/persistent/PersistentTopic.java 79.36% 10 Missing and 3 partials ⚠️
...rg/apache/pulsar/broker/service/BrokerService.java 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23619      +/-   ##
============================================
+ Coverage     73.57%   74.35%   +0.78%     
- Complexity    32624    34488    +1864     
============================================
  Files          1877     1944      +67     
  Lines        139502   147239    +7737     
  Branches      15299    16248     +949     
============================================
+ Hits         102638   109486    +6848     
- Misses        28908    29309     +401     
- Partials       7956     8444     +488     
Flag Coverage Δ
inttests 27.27% <36.70%> (+2.68%) ⬆️
systests 24.32% <39.24%> (+<0.01%) ⬆️
unittests 73.74% <81.01%> (+0.89%) ⬆️

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

Files with missing lines Coverage Δ
.../pulsar/broker/service/persistent/SystemTopic.java 84.21% <ø> (+4.21%) ⬆️
...rg/apache/pulsar/broker/service/BrokerService.java 83.86% <87.50%> (+3.08%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 79.97% <79.36%> (+1.51%) ⬆️

... and 663 files with indirect coverage changes

@shibd shibd changed the title [improve][broker] Decouple pulsar_storage_backlog_age_seconds metric from backlogQuota policy [improve][broker] Decouple pulsar_storage_backlog_age_seconds metric with backlogQuota check Nov 21, 2024
@shibd shibd requested a review from poorbarcode November 28, 2024 07:13
@shibd shibd merged commit 963be2c into apache:master Nov 28, 2024
52 checks passed
shibd added a commit that referenced this pull request Nov 28, 2024
…with backlogQuota check (#23619)

(cherry picked from commit 963be2c)
shibd added a commit that referenced this pull request Nov 28, 2024
…with backlogQuota check (#23619)

(cherry picked from commit 963be2c)
shibd added a commit that referenced this pull request Nov 28, 2024
…with backlogQuota check (#23619)

(cherry picked from commit 963be2c)
// If backlog quota by time is not set
if (backlogQuotaLimitInSecond <= 0) {
return CompletableFuture.completedFuture(false);
if (!(ledger.getCursors() instanceof ManagedCursorContainer managedCursorContainer)) {
Copy link
Member

Choose a reason for hiding this comment

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

Since the ledger.getCursors() exposes the API by an interface, shouldn’t let the implementation to decide the result?

nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 6, 2024
…with backlogQuota check (apache#23619)

(cherry picked from commit 963be2c)
(cherry picked from commit 12eccd2)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 9, 2024
…with backlogQuota check (apache#23619)

(cherry picked from commit 963be2c)
(cherry picked from commit 12eccd2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-3.0 cherry-picked/branch-3.3 cherry-picked/branch-4.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.8 release/3.3.3 release/4.0.1 type/refactor Code or documentation refactors. e.g. refactor code structure or methods to improve code readability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants