-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix REST API to produce messages to single-partitioned topics #24450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][broker] Fix REST API to produce messages to single-partitioned topics #24450
Conversation
|
I am doing pulsarbot run-failure-checks |
…topics, add annotation for rerun CI
The tests for BROKER_GROUP_2 were successfully executed using the command: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…topics (apache#24450) (cherry picked from commit fa28d1c)
…topics (apache#24450) (cherry picked from commit fa28d1c) (cherry picked from commit da9ed2b)
…topics (apache#24450) (cherry picked from commit fa28d1c) (cherry picked from commit da9ed2b)
…topics (apache#24450) (cherry picked from commit fa28d1c) (cherry picked from commit 57e48d1)
…topics (apache#24450) (cherry picked from commit fa28d1c) (cherry picked from commit 57e48d1)
Fixes #24442
Motivation
The REST API fails to produce messages to single-partitioned topics (partition count = 1) due to incorrect topic type detection.
Modifications
TopicsBaseto properly handle single-partitioned topicsif (!topicName.isPartitioned() && metadata.partitions > 1)to
if (!topicName.isPartitioned() && metadata.partitions > 0)Verifying this change
This change added tests and can be verified as follows:
TopicsTest.testProduceToPartitionedTopictest 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
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: Joforde@408ac9d