BewareMyPower commented on code in PR #1340:
URL: https://github.com/apache/pulsar-client-go/pull/1340#discussion_r1978551390


##########
pulsar/consumer_partition.go:
##########
@@ -2195,6 +2226,24 @@ func (pc *partitionConsumer) 
discardCorruptedMessage(msgID *pb.MessageIdData,
 }
 
 func (pc *partitionConsumer) hasNext() bool {
+
+       // If a seek by time has been performed, then the `startMessageId` 
becomes irrelevant.
+       // We need to compare `markDeletePosition` and `lastMessageId`,
+       // and then reset `startMessageID` to `markDeletePosition`.
+       if pc.lastDequeuedMsg == nil && pc.hasSoughtByTime.CompareAndSwap(true, 
false) {
+               res, err := pc.getLastMessageIDAndMarkDeletePosition()
+               if err != nil {
+                       pc.log.WithError(err).Error("Failed to get last message 
id")

Review Comment:
   In this case, `hasSoughtByTime` will still be `false`. Should we restore it 
with true here?



-- 
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]

Reply via email to