Skip to content

Conversation

@shibd
Copy link
Member

@shibd shibd commented Nov 4, 2025

Motivation

When a client attempts to update the number of partitions for a non-partitioned topic, the broker correctly rejects the request with a RestException.

However, it also logs this as an ERROR in the broker logs:

Failed to update partition to 1 java.util.concurrent.CompletionException: org.apache.pulsar.broker.web.RestException: Topic persistent://elps/elps-pulsar-comms/locations is not the partitioned topic. 

The error report here:

if (currentMetadataPartitions <= 0) {
throw new RestException(Status.CONFLICT /* Unprocessable entity*/,
String.format("Topic %s is not the partitioned topic.", topicName));
}

For exceptions that are clearly caused by invalid parameters passed by the client, and which have already been clearly returned to the client, the broker should not log an ERROR.

Modifications

  • Don't log an error when updatePartitionedTopic is called on a non-partitioned topic

Verifying this change

  • non

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:

@shibd shibd requested review from Technoboy- and coderzc November 4, 2025 12:50
@shibd shibd self-assigned this Nov 4, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 4, 2025
@Technoboy- Technoboy- added this to the 4.2.0 milestone Nov 4, 2025
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.28%. Comparing base (676ba07) to head (f40e369).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...pache/pulsar/broker/admin/v2/PersistentTopics.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #24943       +/-   ##
=============================================
+ Coverage     38.56%   74.28%   +35.71%     
- Complexity    13262    33906    +20644     
=============================================
  Files          1856     1913       +57     
  Lines        145287   149450     +4163     
  Branches      16877    17363      +486     
=============================================
+ Hits          56025   111013    +54988     
+ Misses        81696    29590    -52106     
- Partials       7566     8847     +1281     
Flag Coverage Δ
inttests 26.26% <0.00%> (+0.08%) ⬆️
systests 22.63% <0.00%> (-0.14%) ⬇️
unittests 73.82% <0.00%> (+39.08%) ⬆️

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

Files with missing lines Coverage Δ
...pache/pulsar/broker/admin/v2/PersistentTopics.java 87.60% <0.00%> (+74.32%) ⬆️

... and 1415 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 lhotari merged commit e557b00 into apache:master Nov 4, 2025
55 checks passed
shibd added a commit that referenced this pull request Nov 4, 2025
…alled on a non-partitioned topic (#24943)

(cherry picked from commit e557b00)
shibd added a commit that referenced this pull request Nov 4, 2025
…alled on a non-partitioned topic (#24943)

(cherry picked from commit e557b00)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2025
…alled on a non-partitioned topic (apache#24943)

(cherry picked from commit e557b00)
(cherry picked from commit c32dca9)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 2025
…alled on a non-partitioned topic (apache#24943)

(cherry picked from commit e557b00)
(cherry picked from commit c32dca9)
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.

4 participants