Skip to content

Commit e3bfce6

Browse files
committed
add annotation
1 parent 20e0384 commit e3bfce6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,11 @@ private CompletableFuture<? extends Subscription> getNonDurableSubscription(Stri
11621162
if (ledgerId >= 0 && entryId >= 0
11631163
&& msgId instanceof BatchMessageIdImpl
11641164
&& (msgId.getBatchIndex() >= 0 || resetIncludeHead)) {
1165+
// When resetIncludeHead is true, we need to take one step back on the previous message,
1166+
// to ensure the read position starts with startMessageId
1167+
11651168
// When the start message is relative to a batch, we need to take one step back on the previous
1166-
// message,
1167-
// because the "batch" might not have been consumed in its entirety.
1169+
// message, because the "batch" might not have been consumed in its entirety.
11681170
// The client will then be able to discard the first messages if needed.
11691171
entryId = msgId.getEntryId() - 1;
11701172
}

0 commit comments

Comments
 (0)