thetumbled commented on code in PR #21969:
URL: https://github.com/apache/pulsar/pull/21969#discussion_r1470488139
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -2213,8 +2216,23 @@ private void getLargestBatchIndexWhenPossible(
return;
}
- if (lastPosition.getEntryId() == -1 || (compactionHorizon != null
- && lastPosition.compareTo((PositionImpl)
compactionHorizon) <= 0)) {
+ if (lastPosition.getEntryId() == -1 ||
!ml.ledgerExists(lastPosition.getLedgerId())) {
+ // there is no entry in the original topic
+ if (readCompacted) {
+ // if readCompacted is true, we need to read the last
entry from compacted topic
+ handleLastMessageIdFromCompactionService(persistentTopic,
requestId, partitionIndex,
+ markDeletePosition);
+ } else {
+ // if readCompacted is false, we need to return
MessageId.earliest
+
writeAndFlush(Commands.newGetLastMessageIdResponse(requestId, -1, -1,
partitionIndex, -1,
+ markDeletePosition != null ?
markDeletePosition.getLedgerId() : -1,
+ markDeletePosition != null ?
markDeletePosition.getEntryId() : -1));
+ }
+ return;
Review Comment:
fixed.
--
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]