[GitHub] [pulsar] mattisonchao commented on a diff in pull request #19242: [fix] [broker] Counter of pending send messages in Replicator incorrect if schema future not complete

2023-01-16 Thread GitBox


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


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:
##
@@ -184,12 +183,20 @@ protected boolean replicateEntries(List entries) {
 msg.setSchemaInfoForReplicator(schemaFuture.get());
 msg.getMessageBuilder().clearTxnidMostBits();
 msg.getMessageBuilder().clearTxnidLeastBits();
+// Increment pending messages for messages produced locally
+PENDING_MESSAGES_UPDATER.incrementAndGet(this);
+shouldRollbackPendingSendAdd.setTrue();
 producer.sendAsync(msg, ProducerSendCallback.create(this, 
entry, msg));

Review Comment:
   Why do we need `shouldRollbackPendingSendAdd`? Is `producer.sendAsync(msg, 
ProducerSendCallback.create(this, entry, msg))` throws exception?



-- 
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-unsubscr...@pulsar.apache.org

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



[GitHub] [pulsar] mattisonchao commented on a diff in pull request #19242: [fix] [broker] Counter of pending send messages in Replicator incorrect if schema future not complete

2023-01-16 Thread GitBox


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


##
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:
##
@@ -152,6 +154,7 @@ protected boolean replicateEntries(List entries) {
 
 // Increment pending messages for messages produced locally
 PENDING_MESSAGES_UPDATER.incrementAndGet(this);

Review Comment:
   Why can't we move this line to else branch?



-- 
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-unsubscr...@pulsar.apache.org

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