RobertIndie commented on a change in pull request #12403:
URL: https://github.com/apache/pulsar/pull/12403#discussion_r756558399



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -1975,6 +1982,9 @@ public void seek(Function<String, Object> function) 
throws PulsarClientException
                 ackSet.recycle();
 
                 seek = Commands.newSeek(consumerId, requestId, 
msgId.getLedgerId(), msgId.getEntryId(), ackSetArr);
+            } else if(messageId instanceof ChunkMessageIdImpl){
+                ChunkMessageIdImpl msgId = (ChunkMessageIdImpl) messageId;
+                seek = Commands.newSeek(consumerId, requestId, 
msgId.getFirstChunkMessageId().getLedgerId(), 
msgId.getFirstChunkMessageId().getEntryId(), new long[0]);

Review comment:
       >  but it's not guaranteed that you will get publish ACK of first chunk 
before you publish last chunk.
   
   As I said earlier. We don't need that guarantee. I think this is the 
confusing point of the discussion. The firstChunkMessageId that the consumer 
gets at the time of seek is not given by the producer, but is calculated at the 
consumer side.
   I think my previous comments would help understand: 
https://github.com/apache/pulsar/pull/12403#discussion_r747272455
   
   Noted(Here I reply to your previous comment)
   >> and when we processing to the last chunk, the first chunk message id must 
be present.
   >
   > it's not guaranteed.
   
   What I mean by `when we processing to the last chunk` here is processing the 
messageid of the last chunk rather than sending the last chunk. I think it is 
guaranteed. But it's indeed not guaranteed that we will get ACK of first chunk 
before we publish last chunk.
   
   >> The Consumer does not access the first_chunk_message_id in the 
MessageIdData during this process.
   >
   > Please check my below comment in ConsumerImpl class where it accesses it 
and that's the purpose of this PR to access first_chunk_message_id and seek to 
that messageId. but it's not guaranteed that first_chunk_message_id will be 
present and pulsar can claim this feature incorrectly.
   
   The producer does not tell the firstChunkMessageId to the consumer. The 
Consumer receives chunk messages in order, so it is guaranteed that the 
firstChunkMessageId exists after the last chunk message is received.
   
   




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