Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

Motivation

The createIfMissing argument only represents the topic can be created automatically when it does not exist, but it might not trigger the topic creation in this getTopic call. Hence, we cannot simply pass 1 as the 2nd argument here:

Assuming maxTopicsPerNamespace is 10, then the following two cases will both fail.

Case 1:

> admin topics create-partitioned-topic my-topic -p 10
> client produce -m msg my-topic

Case 2:

> admin topics create-partitioned-topic dummy -p 9
> admin topics create my-topic
> admin topics unload my-topic
> client produce -m msg my-topic

Modifications

Add an overload of checkMaxTopicsPerNamespace, which verifies if the topic exists first. Only call the other overload when the topic does not exist. In createPersistentTopic0, call this new overload. Improve testMaxTopicsPerNamespace to verify this change.

Documentation

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

Matching PR in forked repository

PR in forked repository:

@BewareMyPower BewareMyPower self-assigned this Jul 25, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 25, 2025
@BewareMyPower BewareMyPower added type/bug The PR fixed a bug or issue reported a bug area/broker labels Jul 25, 2025
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 @BewareMyPower

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.33%. Comparing base (bbc6224) to head (8ad9646).
⚠️ Report is 1250 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24560      +/-   ##
============================================
+ Coverage     73.57%   74.33%   +0.76%     
- Complexity    32624    32973     +349     
============================================
  Files          1877     1876       -1     
  Lines        139502   146276    +6774     
  Branches      15299    16774    +1475     
============================================
+ Hits         102638   108739    +6101     
+ Misses        28908    28899       -9     
- Partials       7956     8638     +682     
Flag Coverage Δ
inttests 26.87% <60.00%> (+2.29%) ⬆️
systests 23.32% <60.00%> (-1.00%) ⬇️
unittests 73.82% <100.00%> (+0.97%) ⬆️

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/BrokerService.java 84.08% <100.00%> (+3.30%) ⬆️

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

@BewareMyPower BewareMyPower merged commit 1c5c765 into apache:master Jul 25, 2025
71 of 75 checks passed
@BewareMyPower
Copy link
Contributor Author

I see 4.0.6 has not started the release, change the release label to 4.0.6

nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 28, 2025
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 28, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 29, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 30, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 31, 2025
@lhotari lhotari added this to the 4.1.0 milestone Sep 17, 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.

3 participants