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


##########
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.hasSoughtByTime.CompareAndSwap(true, false) {

Review Comment:
   However, we need to add a new condition: when `&& lastDequeuedMsg == nil`. 
This is because the user might have received the message but hasn't called this 
method.



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