shibd commented on code in PR #1340:
URL: https://github.com/apache/pulsar-client-go/pull/1340#discussion_r1983247669
##########
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:
Yes, it should actually return an error, but the API wasn't designed that
way. Of course, I'll set it to true and let the next call continue with this
logic.
--
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]