poorbarcode commented on code in PR #20128:
URL: https://github.com/apache/pulsar/pull/20128#discussion_r1171415064


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java:
##########
@@ -1756,4 +1763,93 @@ public void testReplicatorProducerNotExceed() throws 
Exception {
 
         Assert.assertThrows(PulsarClientException.ProducerBusyException.class, 
() -> new MessageProducer(url2, dest2));
     }
+
+    @Test
+    public void testDiscontinuousMessages() throws Exception {

Review Comment:
   @codelipenghui 
   
   I see:
   - for scenario-1: race condition of `read entries` and `rewind`
     - a separate PR or PIP will solve this problem
   - for scenario-3: 
https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java#L190-L192
     - restart Replicator to fix it. 
   
   ####  for scenario-2:  the task replicate messages is aborted by a loading 
schema
   
   | time | `receive messages` | `async load schema` |
   | --- | --- | --- |
   | 1 | receive messages `1~3` | 
   | 2 | async load schema if needed |
   | 3 | receive messages `4~5`|
   | 4 | send messages `4~5` to remote cluster | 
   | 5 | | load schema success, rewind cursor to position `1`  |
   | 6 | <strong>(Highlight)</strong>Receive messages `1~3` and will send fail 
by duplication check |
   
   This scenario is hard to fix.  Because there is no clear marker of which 
in-flight reads need to be discarded after step-2. I think I should learn how 
the connector handle messages.



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