-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix wrong backlog age metrics when the mark delete position point to a deleted ledger#24518
[fix][broker] Fix wrong backlog age metrics when the mark delete position point to a deleted ledger#24518codelipenghui merged 1 commit intoapache:masterfrom
Conversation
Motivation
The mark delete position may point to ledgers that have been cleaned up/deleted. This causes:
- pulsar_storage_backlog_age_seconds metric returns -1 instead of actual backlog age after topic unloading
- Prometheus monitoring shows incorrect backlog age for lagged subscriptions
You can use the newly added test to reproduce the issue.
Verifying this change
Added new test
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
|
/pulsarbot run-failure-checks |
Codecov ReportAll modified and coverable lines are covered by tests
Additional details and impacted files@@ Coverage Diff @@
## master #24518 +/- ## ============================================ + Coverage 73.57% 74.29% +0.72% + Complexity 32624 32498 -126 ============================================ Files 1877 1868 -9 Lines 139502 145946 +6444 Branches 15299 16737 +1438 ============================================ + Hits 102638 108431 +5793 - Misses 28908 28922 +14 - Partials 7956 8593 +637
Flags with carried forward coverage won't be shown. Click here to find out more.
New features to boost your workflow:
|
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 7282c06)
(cherry picked from commit 6c8d558)
(cherry picked from commit 7282c06)
(cherry picked from commit 6c8d558)
|
@codelipenghui When backporting this to branch-3.0, the added test fails. (backport in commit lhotari@eaa1670) [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 32.705 s <<< FAILURE! - in org.apache.pulsar.broker.service.persistent.PersistentTopicProtectedMethodsTestDo you have a chance to backport this to branch-3.0? |
|
@codelipenghui Do you have a chance to backport this to branch-3.0? |
Cherry-picked PR apache#24518 to branch-3.0 with necessary API compatibility fixes:
- Cast ManagedLedger to ManagedLedgerImpl for getFirstPosition() and getNextValidPosition()
- Fixed admin client URL path from "backlogQuotaCheck" to "backlog-quota-check" to match server endpoint
This ensures the backlog quota check test passes and admin.brokers().backlogQuotaCheck() works correctly.
Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude
(cherry picked from commit a20358067641808d8f7a792090f070741685602f)
(cherry picked from commit 41c32d6)
(cherry picked from commit 41c32d6)
Signed-off-by: Zixuan Liu