Skip to content

Conversation

@3pacccccc
Copy link
Contributor

Motivation

When a producer in WaitForExclusive mode is created while shared producers exist on a topic, it fails to become active even after all shared producers are closed. This occurs because the broker doesn't properly check for waiting exclusive producers when the last shared producer is removed.

Steps to reproduce:

  1. Create a producer with Shared mode
  2. Create a producer with WaitForExclusive mode
  3. Close the first producer
  4. The exclusive producer never gets created

Modifications

  • Modified the condition in handleProducerRemoved() to also check for waiting exclusive producers when the last producer is removed
  • Added test case to verify the fix

Verifying this change

  • Make sure that the change passes the CI checks.

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: 3pacccccc#13

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, good work @3pacccccc

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.30%. Comparing base (bbc6224) to head (d1645a6).
Report is 1217 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24516      +/-   ##
============================================
+ Coverage     73.57%   74.30%   +0.73%     
+ Complexity    32624    32583      -41     
============================================
  Files          1877     1874       -3     
  Lines        139502   146231    +6729     
  Branches      15299    16772    +1473     
============================================
+ Hits         102638   108662    +6024     
- Misses        28908    28935      +27     
- Partials       7956     8634     +678     
Flag Coverage Δ
inttests 26.84% <0.00%> (+2.26%) ⬆️
systests 23.26% <0.00%> (-1.07%) ⬇️
unittests 73.81% <100.00%> (+0.96%) ⬆️

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

Files with missing lines Coverage Δ
...rg/apache/pulsar/broker/service/AbstractTopic.java 88.18% <100.00%> (+0.19%) ⬆️

... and 1107 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.

@crossoverJie crossoverJie merged commit efe9dc8 into apache:master Jul 23, 2025
186 of 192 checks passed
lhotari pushed a commit that referenced this pull request Jul 23, 2025
…er closes (#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
lhotari pushed a commit that referenced this pull request Jul 23, 2025
…er closes (#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
lhotari pushed a commit that referenced this pull request Jul 23, 2025
…er closes (#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
(cherry picked from commit 102fdb3)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
(cherry picked from commit 102fdb3)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
(cherry picked from commit efc9fa5)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
(cherry picked from commit 102fdb3)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
(cherry picked from commit efc9fa5)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
…er closes (apache#24516)

Co-authored-by: crossoverJie <[email protected]>
(cherry picked from commit efe9dc8)
@3pacccccc 3pacccccc deleted the fixWaitingExclusiveProducers branch August 7, 2025 11:17
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.

6 participants