-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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]unify time unit at dropping the backlog on a topic #17957
Conversation
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
Outdated
Show resolved
Hide resolved
@AnonHxy PTAL |
/pulsarbot ready-to-test |
/pulsarbot run-failure-checks |
/pulsarbot ready-to-test |
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
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.
Nice catch!
@@ -220,7 +220,7 @@ private void dropBacklogForTimeLimit(PersistentTopic persistentTopic, BacklogQuo | |||
} | |||
// Timestamp only > 0 if ledger has been closed | |||
if (ledgerInfo.getTimestamp() > 0 | |||
&& currentMillis - ledgerInfo.getTimestamp() > quota.getLimitTime()) { | |||
&& currentMillis - ledgerInfo.getTimestamp() > quota.getLimitTime() * 1000) { |
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.
It's a confusing name :)
We should deprecate the old name limitTime
and introduce a new one limitTimeInSec
Not for this PR, we can start a new discussion in the dev mailing list and make it only happen on the next major release @HQebupt
(cherry picked from commit add77aa)
(cherry picked from commit add77aa)
(cherry picked from commit add77aa)
…pping the backlog on a topic)
…at dropping the backlog on a topic) (cherry picked from commit 95748ca)
…at dropping the backlog on a topic) (cherry picked from commit 95748ca)
Motivation
The backlog quota in time does not work due to time unit inconsistency in dropping the backlog on a topic.
The unit of backlog quota limit in time is seconds.
pulsar/pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/BacklogQuota.java
Lines 47 to 52 in 8d13ff8
The time unit inconsistency is here as follows.
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
Lines 221 to 224 in 8d13ff8
Modifications
unify time unit.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
doc-not-needed
doc
doc-complete
Matching PR in forked repository
PR in forked repository: HQebupt#3