You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "mattisonchao (via GitHub)" <gi...@apache.org> on 2023/07/10 06:20:19 UTC

[GitHub] [pulsar] mattisonchao commented on a diff in pull request #20767: [fix] [broker] Can not receive any messages after switch to standby cluster

mattisonchao commented on code in PR #20767:
URL: https://github.com/apache/pulsar/pull/20767#discussion_r1257758844


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionsController.java:
##########
@@ -194,8 +194,12 @@ private void receiveSubscriptionUpdated(ReplicatedSubscriptionsUpdate update) {
             // Subscription doesn't exist. We need to force the creation of the subscription in this cluster, because
             log.info("[{}][{}] Creating subscription at {}:{} after receiving update from replicated subcription",
                     topic, update.getSubscriptionName(), updatedMessageId.getLedgerId(), pos);
-            topic.createSubscription(update.getSubscriptionName(),
-                    InitialPosition.Latest, true /* replicateSubscriptionState */, null);
+            topic.createSubscription(update.getSubscriptionName(), InitialPosition.Earliest,
+                            true /* replicateSubscriptionState */, null)

Review Comment:
   Please give an empty map for the last param to avoid NPE. :) 



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org