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][PIP-318] Support not retaining null-key message during topic compaction #21578

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

coderzc
Copy link
Member

@coderzc coderzc commented Nov 14, 2023

PIP: #21541

Motivation

Implement #21541

Modifications

  • Add config topicCompactionRetainNullKey in the broker.conf, the default value is false.
  • If not retaining null-key message, add an empty single message placeholder to result when rebatching the message.
  • If the message with null-key, then add a null-key value to the result list of extractIdsAndKeysAndSize and record the delete event.

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

Documentation

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

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 14, 2023
@coderzc coderzc force-pushed the compaction_not_retain_nullkey branch from 7fbe7b5 to cb1b764 Compare November 14, 2023 08:58
@coderzc coderzc changed the title [improve][broker] Support not retaining null-key message during topic compaction [improve][broker][PIP-318] Support not retaining null-key message during topic compaction Nov 15, 2023
@coderzc coderzc added this to the 3.2.0 milestone Nov 15, 2023
@coderzc coderzc force-pushed the compaction_not_retain_nullkey branch from ad93df2 to 4ff06cf Compare November 16, 2023 02:47
@coderzc coderzc closed this Nov 16, 2023
@coderzc coderzc reopened this Nov 16, 2023
@coderzc coderzc force-pushed the compaction_not_retain_nullkey branch from a1ae5f1 to 1ca9ce5 Compare November 17, 2023 06:06
@codecov-commenter
Copy link

Codecov Report

Merging #21578 (1ca9ce5) into master (44abba9) will increase coverage by 0.02%.
Report is 20 commits behind head on master.
The diff coverage is 87.50%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #21578      +/-   ##
============================================
+ Coverage     73.27%   73.29%   +0.02%     
- Complexity    32676    32705      +29     
============================================
  Files          1892     1892              
  Lines        140632   140721      +89     
  Branches      15467    15489      +22     
============================================
+ Hits         103044   103146     +102     
+ Misses        29497    29470      -27     
- Partials       8091     8105      +14     
Flag Coverage Δ
inttests 24.11% <12.50%> (-0.24%) ⬇️
systests 24.68% <12.50%> (-0.29%) ⬇️
unittests 72.57% <87.50%> (+0.02%) ⬆️

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

Files Coverage Δ
...org/apache/pulsar/broker/ServiceConfiguration.java 99.38% <100.00%> (+<0.01%) ⬆️
...g/apache/pulsar/client/impl/RawBatchConverter.java 93.75% <87.50%> (+0.24%) ⬆️
...rg/apache/pulsar/compaction/TwoPhaseCompactor.java 73.83% <85.71%> (-4.24%) ⬇️

... and 99 files with indirect coverage changes

@coderzc coderzc merged commit e1318b2 into apache:master Nov 20, 2023
50 checks passed
coderzc added a commit to coderzc/pulsar that referenced this pull request Nov 21, 2023
@coderzc coderzc added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages type/bug The PR fixed a bug or issue reported a bug and removed type/bug The PR fixed a bug or issue reported a bug labels Nov 21, 2023
@@ -538,6 +538,9 @@ brokerServiceCompactionThresholdInBytes=0
# If the execution time of the compaction phase one loop exceeds this time, the compaction will not proceed.
brokerServiceCompactionPhaseOneLoopTimeInSeconds=30

# Whether retain null-key message during topic compaction
topicCompactionRemainNullKey=false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
topicCompactionRemainNullKey=false
topicCompactionRetainNullKey=false

Copy link
Contributor

Choose a reason for hiding this comment

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

@coderzc I just saw this typo in the config key :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I open a new PR to fix it. #21690

Technoboy- pushed a commit that referenced this pull request Dec 14, 2023
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 20, 2023
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 20, 2023
coderzc added a commit that referenced this pull request Jan 4, 2024
nodece pushed a commit to nodece/pulsar that referenced this pull request Feb 23, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 1, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker area/compaction cherry-picked/branch-2.10 cherry-picked/branch-2.11 cherry-picked/branch-3.0 cherry-picked/branch-3.1 doc-not-needed Your PR changes do not impact docs release/2.10.6 release/2.11.3 release/3.0.3 release/3.1.2 type/bug The PR fixed a bug or issue reported a bug type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants