Skip to content

Conversation

@poorbarcode
Copy link
Contributor

Motivation

Configurations:

  • allowAutoTopicCreation: false
  • brokerDeleteInactiveTopicsEnabled: true
  • brokerDeleteInactivePartitionedTopicMetadataEnabled: false

Steps of the issue occurred

  • Create a topic with 2 partitions.
  • Publish and consume messages.
  • Stop all clients.
  • partition-0 is deleted because of no backlog.
  • Restart clients failed, and get a TopicNotFoundExpection.

Modifications

  • Since the partitioned topic metadata still exists, broker should allow to load up partitions.

Documentation

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

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Aug 20, 2025
@poorbarcode poorbarcode added release/4.0.7 type/bug The PR fixed a bug or issue reported a bug labels Aug 20, 2025
@poorbarcode poorbarcode added this to the 4.1.0 milestone Aug 20, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 20, 2025
@poorbarcode poorbarcode force-pushed the fix/create_topic_after_gc branch from e4f7c20 to 97c024c Compare August 25, 2025 08:20
@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@coderzc coderzc closed this Aug 27, 2025
@coderzc coderzc reopened this Aug 27, 2025
@coderzc
Copy link
Member

coderzc commented Aug 27, 2025

@poorbarcode Please fix code style issue.

@poorbarcode poorbarcode force-pushed the fix/create_topic_after_gc branch from 635b6d4 to e11f75e Compare August 27, 2025 12:05
@poorbarcode
Copy link
Contributor Author

@nodece

I changed the test that you added: testCreateProducerWhenSinglePartitionIsDeleted, because I have fixed the behaviour of the topic auto-creation.

Please take a look

Copy link
Member

@nodece nodece left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

This is an important change because it allows partition recreation when allowAutoTopicCreation=false and partitioned metadata exists.
To clarify this behavior, I recommend updating the Javadoc for allowAutoTopicCreation to reflect this.

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.26%. Comparing base (a532798) to head (e07e974).
⚠️ Report is 266 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #24651   +/-   ##
=========================================
  Coverage     74.26%   74.26%           
- Complexity    33200    33220   +20     
=========================================
  Files          1885     1885           
  Lines        146953   146969   +16     
  Branches      16928    16931    +3     
=========================================
+ Hits         109129   109146   +17     
- Misses        29104    29134   +30     
+ Partials       8720     8689   -31     
Flag Coverage Δ
inttests 26.64% <44.44%> (-0.17%) ⬇️
systests 22.69% <0.00%> (-0.03%) ⬇️
unittests 73.74% <100.00%> (+<0.01%) ⬆️

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 83.74% <100.00%> (-0.15%) ⬇️

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

@poorbarcode poorbarcode merged commit 7c57683 into apache:master Aug 28, 2025
51 checks passed
poorbarcode added a commit that referenced this pull request Aug 28, 2025
…leted because topic GC (#24651)

(cherry picked from commit 7c57683)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 28, 2025
…leted because topic GC (apache#24651)

(cherry picked from commit 7c57683)
(cherry picked from commit eef82db)
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Sep 10, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 12, 2025
…leted because topic GC (apache#24651)

(cherry picked from commit 7c57683)
(cherry picked from commit eef82db)
nborisov pushed a commit to nborisov/pulsar that referenced this pull request Sep 12, 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

Labels

cherry-picked/branch-4.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/4.0.7 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants