codelipenghui commented on code in PR #17154:
URL: https://github.com/apache/pulsar/pull/17154#discussion_r948967827


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:
##########
@@ -364,16 +378,31 @@ public void readEntriesComplete(List<Entry> entries, 
Object ctx) {
 
                 headersAndPayload.retain();
 
-                getSchemaInfo(msg).thenAccept(schemaInfo -> {
-                    msg.setSchemaInfoForReplicator(schemaInfo);
+                CompletableFuture<SchemaInfo> schemaFuture = 
getSchemaInfo(msg);
+                if (!schemaFuture.isDone() || 
schemaFuture.isCompletedExceptionally()) {
+                    // Mark the replicator is fetching the schema for now and 
rewind the cursor
+                    // and trigger the next read after complete the schema 
fetching.
+                    fetchSchemaInProgress = true;
+                    skipRemainingMessages = true;

Review Comment:
   Oh, nice catch!
   Yes, we need to release the first entry.
   



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