summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThuan Duong Ba <thuandb@amazon.com>2021-12-16 10:31:36 -0800
committerThuan Duong-Ba <59986634+thuandb@users.noreply.github.com>2021-12-20 17:39:06 -0800
commitfe8bd1508a501ba03113a9b1c4ff981d11d6c4e0 (patch)
tree6949d305a896edcd07e39bcd99fa7e61c44c49b7
parent83b94ca6a91dc936edae55fd5fe8ab89f960033f (diff)
downloadrabbitmq-server-git-fe8bd1508a501ba03113a9b1c4ff981d11d6c4e0.tar.gz
fix the sync pause time calculation
-rw-r--r--deps/rabbit/src/rabbit_mirror_queue_sync.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/deps/rabbit/src/rabbit_mirror_queue_sync.erl b/deps/rabbit/src/rabbit_mirror_queue_sync.erl
index 3189966201..26554ece83 100644
--- a/deps/rabbit/src/rabbit_mirror_queue_sync.erl
+++ b/deps/rabbit/src/rabbit_mirror_queue_sync.erl
@@ -177,9 +177,8 @@ pause_queue_sync(Delta) ->
%% The amount of time to pause queue sync is the different between time needed to broadcast TotalBytes at max throughput
%% and the elapsed time (Interval).
get_time_diff(TotalBytes, Interval, SyncThroughput) ->
- UsedThroughput = round(TotalBytes * 1000 / Interval),
- rabbit_log_mirroring:debug("Total ~p bytes has been sent over last ~p ms. Effective sync througput: ~p", [TotalBytes, Interval, UsedThroughput]),
- max(round(UsedThroughput/SyncThroughput * 1000 - Interval), 0).
+ rabbit_log_mirroring:debug("Total ~p bytes has been sent over last ~p ms. Effective sync througput: ~p", [TotalBytes, Interval, round(TotalBytes * 1000 / Interval)]),
+ max(round(TotalBytes/SyncThroughput * 1000 - Interval), 0).
master_done({Syncer, Ref, _Log, _HandleInfo, _EmitStats, Parent}, BQS) ->
receive