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]unify time unit at dropping the backlog on a topic #17957

Merged
merged 2 commits into from
Oct 10, 2022

Conversation

HQebupt
Copy link
Contributor

@HQebupt HQebupt commented Oct 7, 2022

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.

/**
* Gets quota limit in time.
*
* @return quota limit in second
*/
int getLimitTime();

The time unit inconsistency is here as follows.

// Timestamp only > 0 if ledger has been closed
if (ledgerInfo.getTimestamp() > 0
&& currentMillis - ledgerInfo.getTimestamp() > quota.getLimitTime()) {
// skip whole ledger for the slowest cursor

Modifications

unify time unit.

Verifying this change

  • Make sure that the change passes the CI checks.

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 changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

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

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 7, 2022
@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 7, 2022

@HQebupt HQebupt requested a review from AnonHxy October 8, 2022 02:13
@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 8, 2022

@AnonHxy PTAL

@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 8, 2022

/pulsarbot ready-to-test

@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 8, 2022

/pulsarbot run-failure-checks

@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 9, 2022

/pulsarbot ready-to-test

@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 9, 2022

/pulsarbot run-failure-checks

2 similar comments
@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 9, 2022

/pulsarbot run-failure-checks

@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 9, 2022

/pulsarbot run-failure-checks

Copy link
Contributor

@codelipenghui codelipenghui left a 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) {
Copy link
Contributor

@codelipenghui codelipenghui Oct 10, 2022

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

@codelipenghui codelipenghui merged commit add77aa into apache:master Oct 10, 2022
congbobo184 pushed a commit that referenced this pull request Nov 14, 2022
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 14, 2022
congbobo184 pushed a commit that referenced this pull request Dec 7, 2022
congbobo184 added a commit that referenced this pull request Dec 7, 2022
### Motivation
fix cherry-pick #17609 import
fix cherry-pick #17957  import
fix cherry-pick #16878 lose problem
fix cherry-pick #17503 problem
liangyepianzhou pushed a commit that referenced this pull request Dec 8, 2022
liangyepianzhou added a commit that referenced this pull request Dec 8, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
…at dropping the backlog on a topic)

(cherry picked from commit 95748ca)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
…at dropping the backlog on a topic)

(cherry picked from commit 95748ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants