BewareMyPower commented on code in PR #21887:
URL: https://github.com/apache/pulsar/pull/21887#discussion_r1455381414
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -1835,7 +1835,7 @@ protected void handleSend(CommandSend send, ByteBuf
headersAndPayload) {
? PositionImpl.get(send.getMessageId().getLedgerId(),
send.getMessageId().getEntryId()) : null;
// Persist the message
- if (send.hasHighestSequenceId() && send.getSequenceId() <=
send.getHighestSequenceId()) {
+ if (send.hasHighestSequenceId()) {
Review Comment:
It does not make sense without adding a test to show which issue it fixes.
IMO, the original code is just defensive programming that handles the
exceptional case that `sequence_id` > `highest_sequence_id` when the client
constructs the `CommandSend` request. Though with the correct implementation,
the client should not set a sequence id that is greater than the highest
sequence id.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]