Skip to content

Conversation

@Joforde
Copy link
Contributor

@Joforde Joforde commented Jun 24, 2025

Fixes #24442

Motivation

The REST API fails to produce messages to single-partitioned topics (partition count = 1) due to incorrect topic type detection.

Modifications

  • Fixed topic type detection condition in TopicsBase to properly handle single-partitioned topics
  • Changed from if (!topicName.isPartitioned() && metadata.partitions > 1)
    to if (!topicName.isPartitioned() && metadata.partitions > 0)

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Extended TopicsTest.testProduceToPartitionedTopic test cases with single-partition topic testing.

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: Joforde@408ac9d

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 24, 2025
@BewareMyPower BewareMyPower added release/3.0.13 release/4.0.6 release/3.3.8 type/bug The PR fixed a bug or issue reported a bug labels Jun 26, 2025
@Joforde
Copy link
Contributor Author

Joforde commented Jun 26, 2025

I am doing pulsarbot run-failure-checks

@Joforde
Copy link
Contributor Author

Joforde commented Jun 29, 2025

I am doing pulsarbot run-failure-checks

The tests for BROKER_GROUP_2 were successfully executed using the command:
mvn test -pl pulsar-broker -Dgroups='schema,utils,functions-worker,broker-io,broker-discovery,broker-compaction,broker-naming,broker-replication,websocket,other',
as confirmed by the successful GitHub Actions run:
https://github.com/Joforde/pulsar/actions/runs/15842886147/job/44659112127.

@Technoboy- Technoboy- closed this Jul 31, 2025
@Technoboy- Technoboy- reopened this Jul 31, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.94%. Comparing base (bbc6224) to head (a8db02c).
⚠️ Report is 1243 commits behind head on master.

Files with missing lines Patch % Lines
...java/org/apache/pulsar/broker/rest/TopicsBase.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24450      +/-   ##
============================================
+ Coverage     73.57%   75.94%   +2.36%     
- Complexity    32624    36257    +3633     
============================================
  Files          1877     1882       +5     
  Lines        139502   159994   +20492     
  Branches      15299    20103    +4804     
============================================
+ Hits         102638   121504   +18866     
- Misses        28908    29516     +608     
- Partials       7956     8974    +1018     
Flag Coverage Δ
inttests 26.75% <0.00%> (+2.17%) ⬆️
systests 24.90% <0.00%> (+0.58%) ⬆️
unittests 75.47% <0.00%> (+2.63%) ⬆️

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

Files with missing lines Coverage Δ
...java/org/apache/pulsar/broker/rest/TopicsBase.java 57.63% <0.00%> (-0.68%) ⬇️

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

@Technoboy- Technoboy- added this to the 4.1.0 milestone Aug 1, 2025
@Technoboy- Technoboy- merged commit fa28d1c into apache:master Aug 1, 2025
188 of 208 checks passed
lhotari pushed a commit that referenced this pull request Aug 4, 2025
lhotari pushed a commit that referenced this pull request Aug 4, 2025
lhotari pushed a commit that referenced this pull request Aug 4, 2025
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Aug 6, 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
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 20, 2025
…topics (apache#24450)

(cherry picked from commit fa28d1c)
(cherry picked from commit da9ed2b)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 20, 2025
…topics (apache#24450)

(cherry picked from commit fa28d1c)
(cherry picked from commit da9ed2b)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 20, 2025
…topics (apache#24450)

(cherry picked from commit fa28d1c)
(cherry picked from commit 57e48d1)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Aug 26, 2025
…topics (apache#24450)

(cherry picked from commit fa28d1c)
(cherry picked from commit 57e48d1)
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.

[Bug] REST API to produce messages to a single-partitioned topic fails with "Unable to add schema" error

7 participants