poorbarcode commented on code in PR #20128:
URL: https://github.com/apache/pulsar/pull/20128#discussion_r1171183018
##########
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
> Will the current solution make the replicator not able to re-replicate
data(reset the cursor of the replicator) to the remote cluster unless restart
the replicator?
1. If someone moves Replicator's cursor to a larger pointer manually(such as
`pulsar-admin topics resetCursor`), everything is ok. The logic of checking
"whether the message is continuous or not" is `first_message_received <=
Max(mark_deleted_pos, last_sent_pos) + 1`, since `resetCursor` will move the
variable `markDeletePosition` to a larger value too, the continuous check will
return `true`.
2. If someone moves Replicator's cursor to a smaller pointer manually(such
as `rewind` or `pulsar-admin topics resetCursor`), everything is ok.
> And will the solution be resolved by unloading the topic if the replicator
runs into an exception?
If something makes the variable `lastSent` to a wrong value, it can be
solved by `unload topic`
--
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]