Skip to content

Conversation

@hangc0276
Copy link
Contributor

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

RawReader is a wrapper for Consumer, but it doesn't expose the pause and resume interface. We have a RawReader pool that cached a lot of RawReaders, and when the Pulsar broker restarts or the topic is unloaded, the Pulsar client will reconnect to the broker and prefetch messages from the Pulsar broker, making the RawReader pool run out of memory and bring heavy on the Pulsar broker especially when the data has been offloaded to the tiered storage.

Modifications

Expose the pause and resume interface for RawReader to avoid prefetch messages when Pulsar broker restart or topic unload.

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:

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.34%. Comparing base (fa28d1c) to head (02aeefd).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24597      +/-   ##
============================================
- Coverage     74.47%   74.34%   -0.13%     
+ Complexity    32735    32680      -55     
============================================
  Files          1880     1880              
  Lines        146433   146437       +4     
  Branches      16789    16789              
============================================
- Hits         109055   108873     -182     
- Misses        28767    28917     +150     
- Partials       8611     8647      +36     
Flag Coverage Δ
inttests 26.73% <0.00%> (-0.52%) ⬇️
systests 23.39% <0.00%> (-0.07%) ⬇️
unittests 73.83% <100.00%> (-0.13%) ⬇️

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

Files with missing lines Coverage Δ
...n/java/org/apache/pulsar/client/api/RawReader.java 100.00% <ø> (ø)
...a/org/apache/pulsar/client/impl/RawReaderImpl.java 85.47% <100.00%> (+0.51%) ⬆️

... and 78 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lhotari
Copy link
Member

lhotari commented Aug 4, 2025

/pulsarbot rerun-failure-checks

@hangc0276 hangc0276 merged commit 7274ee1 into apache:master Aug 5, 2025
89 of 91 checks passed
hangc0276 added a commit that referenced this pull request Aug 5, 2025
gaozhangmin pushed a commit to gaozhangmin/pulsar that referenced this pull request Aug 13, 2025
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Aug 14, 2025
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 20, 2025
(cherry picked from commit 7274ee1)
(cherry picked from commit 398f5ce)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 26, 2025
(cherry picked from commit 7274ee1)
(cherry picked from commit 398f5ce)
@lhotari lhotari added this to the 4.1.0 milestone Sep 17, 2025
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
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.

5 participants