Skip to content

Commit

Permalink
[fix][broker] Record GeoPersistentReplicator.msgOut before producer#s…
Browse files Browse the repository at this point in the history
…endAsync (#21673)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
  • Loading branch information
nodece authored and Technoboy- committed Dec 8, 2023
1 parent 2393ca7 commit c4196fb
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ protected boolean replicateEntries(List<Entry> entries) {
}

dispatchRateLimiter.ifPresent(rateLimiter -> rateLimiter.tryDispatchPermit(1, entry.getLength()));

msgOut.recordEvent(headersAndPayload.readableBytes());

msg.setReplicatedFrom(localCluster);

headersAndPayload.retain();
Expand Down Expand Up @@ -181,6 +178,7 @@ protected boolean replicateEntries(List<Entry> entries) {
msg.setSchemaInfoForReplicator(schemaFuture.get());
msg.getMessageBuilder().clearTxnidMostBits();
msg.getMessageBuilder().clearTxnidLeastBits();
msgOut.recordEvent(headersAndPayload.readableBytes());
// Increment pending messages for messages produced locally
PENDING_MESSAGES_UPDATER.incrementAndGet(this);
producer.sendAsync(msg, ProducerSendCallback.create(this, entry, msg));
Expand Down

0 comments on commit c4196fb

Please sign in to comment.