merlimat commented on a change in pull request #1231: Read from compacted topic 
ledger if available and enabled
URL: https://github.com/apache/incubator-pulsar/pull/1231#discussion_r169097665
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
 ##########
 @@ -297,7 +297,11 @@ protected void readMoreEntries(Consumer consumer) {
                 log.debug("[{}-{}] Schedule read of {} messages", name, 
consumer, messagesToRead);
             }
             havePendingRead = true;
-            cursor.asyncReadEntriesOrWait(messagesToRead, this, consumer);
+            if (consumer.readCompacted()) {
+                topic.compactedTopic.asyncReadEntriesOrWait(cursor, 
messagesToRead, this, consumer);
 
 Review comment:
   > it does. This is why we pass the cursor in. Otherwise we'd have something 
like
   
   Got it, I had missed that part.
   
   >  i.e. a compaction could happen in between
   
   Shouldn't we be able to reset the subscription on the current snapshot and 
read from it. If there is another compaction ongoing, it should affect it. The 
data after the 1st snapshot would still be there. The only thing that might get 
complicated would be to delete the compacted ledger only after no one is using 
it anymore. This could a be an improvement for later anyway.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to