File tree 1 file changed +4
-2
lines changed
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1162,9 +1162,11 @@ private CompletableFuture<? extends Subscription> getNonDurableSubscription(Stri
1162
1162
if (ledgerId >= 0 && entryId >= 0
1163
1163
&& msgId instanceof BatchMessageIdImpl
1164
1164
&& (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
+
1165
1168
// 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.
1168
1170
// The client will then be able to discard the first messages if needed.
1169
1171
entryId = msgId .getEntryId () - 1 ;
1170
1172
}
You can’t perform that action at this time.
0 commit comments