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] Add additionalSystemCursorNames ignore list for TTL check #22614

Conversation

hangc0276
Copy link
Contributor

@hangc0276 hangc0276 commented Apr 29, 2024

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

Message TTL will move the cursors based on the configured ttlDurationDefaultInSeconds. However, for those system topics' cursors, such as compaction service cursor, transaction system topic cursor, and even some third-party plugins cursors, should not or don't want to be impacted by the TTL.

We have one PR #21865 to filter the compaction service cursors for TTL check, but doesn't cover other system topics cursors. To provide a general solution and support third-party plugin cursors not impacted by TTL, I proposed to add a systemCursorNames ignore list to filter the TTL check.

Modifications

Add a configuration in conf/broker.conf to support filter subscriptions for TTL check.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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

Matching PR in forked repository

PR in forked repository:

@hangc0276 hangc0276 self-assigned this Apr 29, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Apr 29, 2024
@hangc0276 hangc0276 added category/functionality Some functions are not working such as get errors release/3.2.3 and removed doc-not-needed Your PR changes do not impact docs labels Apr 29, 2024
@hangc0276 hangc0276 added this to the 3.3.0 milestone Apr 29, 2024
@hangc0276 hangc0276 added ready-to-test doc-not-needed Your PR changes do not impact docs labels Apr 29, 2024
@codelipenghui
Copy link
Contributor

@hangc0276 Maybe we'd better introduce a system subscription concept to avoid the TTL, backlog quota policy(consumer eviction) applied to the system subscription.

For example:

systemCursorNames=__compaction,__dedup

@hangc0276 hangc0276 changed the title [improve] [broker] Add subscription ignore list for ttl check [improve] [broker] Add systemCursorNames ignore list for ttl check Apr 30, 2024
@hangc0276
Copy link
Contributor Author

@hangc0276 Maybe we'd better introduce a system subscription concept to avoid the TTL, backlog quota policy(consumer eviction) applied to the system subscription.

For example:

systemCursorNames=__compaction,__dedup

@codelipenghui Make sense. Updated the code.

Copy link
Member

@dao-jun dao-jun left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

I added a review with some details to address.

I think we have a principle to create PIPs when we add new features to Pulsar. The PIP document could be a "1 pager" and minimal. Do you have a plan to document this change as a PIP document?

@lhotari lhotari requested a review from merlimat May 3, 2024 19:48
@hangc0276
Copy link
Contributor Author

I added a review with some details to address.

I think we have a principle to create PIPs when we add new features to Pulsar. The PIP document could be a "1 pager" and minimal. Do you have a plan to document this change as a PIP document?

@lhotari Thanks for your review. I created a PIP for this change. Please help take a look, thanks. #22651

conf/standalone.conf Outdated Show resolved Hide resolved
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@hangc0276 hangc0276 changed the title [improve] [broker] Add systemCursorNames ignore list for ttl check [improve] [broker] Add additionalSystemCursorNames ignore list for TTL check May 7, 2024
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 73.11%. Comparing base (bbc6224) to head (2a02e0f).
Report is 250 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22614      +/-   ##
============================================
- Coverage     73.57%   73.11%   -0.46%     
+ Complexity    32624    32467     -157     
============================================
  Files          1877     1888      +11     
  Lines        139502   141113    +1611     
  Branches      15299    15487     +188     
============================================
+ Hits         102638   103179     +541     
- Misses        28908    29962    +1054     
- Partials       7956     7972      +16     
Flag Coverage Δ
inttests 27.38% <40.00%> (+2.80%) ⬆️
systests 24.66% <40.00%> (+0.34%) ⬆️
unittests 72.13% <80.00%> (-0.72%) ⬇️

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

Files Coverage Δ
...org/apache/pulsar/broker/ServiceConfiguration.java 99.40% <100.00%> (+<0.01%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 79.24% <66.66%> (+0.79%) ⬆️

... and 355 files with indirect coverage changes

@Technoboy- Technoboy- merged commit bed032e into apache:master May 9, 2024
50 checks passed
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.