poorbarcode commented on code in PR #20128:
URL: https://github.com/apache/pulsar/pull/20128#discussion_r1170784504
##########
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
> Ok, if we can reach
https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java#L190-L192,
can we just close the replicator and try to restart the replication task?
Background: Now the Replicator is having some trouble starting and closing:
- After closing the internal producer of Replicator, this Replicator will
not work anymore, there has no mechanism to get it running again
- I will push another PR to fix it.
- The function `disconnect` maybe has a bug that makes the Replicator
continues to work after the internal cursor is closed
- When `startProducer` and `disconnect` run concurrently, the thread
`disconnect` may not get the right producer.
- I will push another PR to fix it.
So there is not yet a stable way to restart Replicator(other than an `unload
topic`).
---
### Summary
Now this PR tries to solve three problems in the same way: `Make the
replicator processes messages only sequentially`
- scenario-1: race condition of `read entries` and `rewind`
- scenario-2: the task replicate messages is aborted by a loading schema
- scenario-3: the task replicate messages is aborted by an unknown error(we
are talking about)
Since scenario-1 and scenario-2 are there, the solution `Make the replicator
processes messages only sequentially` is needed, so we can do no additional
processing on scenario-3.
--
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]