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] Use RoaringBitmap in tracking individual acks to reduce memory usage #23006

Merged
merged 2 commits into from
Jul 6, 2024

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Jul 5, 2024

Fixes #22866

Motivation

There has been a previous attempt to address #22866 in #22908 which caused regressions and this PR was reverted by #22968.
After that, PR #22966 made ConcurrentOpenLongPairRangeSet thread safe and renamed the class to OpenLongPairRangeSet. The PR makes changes to the class to properly and consistently use the existing ReadWriteLock for all accesses.
This PR contains the next step to use the RoaringBitSet class that @dao-jun has contributed to RoaringBitmap 1.1.0. The usage of RoaringBitmap reduces memory usage compared to java.util.BitSet and presumable addresses issue #22866.

Modifications

  • Upgrade RoaringBitmap to 1.2.0
  • Remove unnecessary options from OpenLongPairRangeSet class
  • Use RoaringBitSet in OpenLongPairRangeSet as the BitSet implementation

Documentation

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

@lhotari lhotari added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages ready-to-test release/3.3.1 release/3.0.6 release/3.2.4 labels Jul 5, 2024
@lhotari lhotari added this to the 3.4.0 milestone Jul 5, 2024
@lhotari lhotari self-assigned this Jul 5, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.45%. Comparing base (bbc6224) to head (ea38d93).
Report is 439 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23006      +/-   ##
============================================
- Coverage     73.57%   73.45%   -0.12%     
- Complexity    32624    33301     +677     
============================================
  Files          1877     1912      +35     
  Lines        139502   143195    +3693     
  Branches      15299    15590     +291     
============================================
+ Hits         102638   105190    +2552     
- Misses        28908    29996    +1088     
- Partials       7956     8009      +53     
Flag Coverage Δ
inttests 27.84% <100.00%> (+3.26%) ⬆️
systests 24.73% <100.00%> (+0.40%) ⬆️
unittests 72.49% <100.00%> (-0.35%) ⬇️

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

Files Coverage Δ
...pache/bookkeeper/mledger/impl/RangeSetWrapper.java 94.33% <100.00%> (ø)
.../common/util/collections/OpenLongPairRangeSet.java 90.15% <100.00%> (ø)

... and 492 files with indirect coverage changes

@dao-jun dao-jun merged commit ed39c4d into apache:master Jul 6, 2024
52 of 53 checks passed
lhotari added a commit that referenced this pull request Jul 6, 2024
…duce memory usage (#23006)

(cherry picked from commit ed39c4d)

# Conflicts:
#	distribution/server/src/assemble/LICENSE.bin.txt
lhotari added a commit that referenced this pull request Jul 6, 2024
lhotari added a commit that referenced this pull request Jul 6, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 10, 2024
…duce memory usage (apache#23006)

(cherry picked from commit ed39c4d)

(cherry picked from commit 278d679)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 15, 2024
…duce memory usage (apache#23006)

(cherry picked from commit ed39c4d)

(cherry picked from commit 278d679)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-3.0 cherry-picked/branch-3.2 cherry-picked/branch-3.3 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.6 release/3.2.4 release/3.3.1 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.

High GC pause cases high publish latency
3 participants