Repository navigation
[improve][broker] improve shadow topic error message - #18709
Conversation
| if (isShadowTopic && position == null) { | ||
| cnx.execute(() -> { | ||
| cnx.getCommandSender().sendSendError(producerId, sequenceId, ServerError.NotAllowedError, | ||
| "Cannot send messages to a shadow topic"); |
There was a problem hiding this comment.
We'd better tell this error is caused by position == null
There was a problem hiding this comment.
This position is only used in shadow topic internal replication:
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Lines 1598 to 1602 in 5b062f3
position should be null for regular producers. So I think it's not necessary to tell users about this detail.
There was a problem hiding this comment.
positionshould benullfor regular producers.
Correct. It's only used in ShadowReplicator.
Jason918
left a comment
There was a problem hiding this comment.
Great, thank you for pointing this out.
|
/pulsarbot run-failure-checks |
Codecov Report
@@ Coverage Diff @@
## master #18709 +/- ##
============================================
- Coverage 50.05% 46.75% -3.31%
- Complexity 9706 10441 +735
============================================
Files 618 699 +81
Lines 58586 68734 +10148
Branches 6098 7374 +1276
============================================
+ Hits 29327 32134 +2807
- Misses 26092 33003 +6911
- Partials 3167 3597 +430
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
|
This pr is ready to merge ^_^ |
Motivation
PIP-180 add shadow topic feature. Shadow topic is read-only, but if I send msg to a shadow topic, the error message is
"Only shadow topic supports sending messages with messageId", which is confusing.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository:
PTAL @Jason918