summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Videla <videlalvaro@gmail.com>2015-10-10 23:22:38 +0200
committerAlvaro Videla <videlalvaro@gmail.com>2015-10-10 23:22:38 +0200
commit0646e9d9b74bbc430ea8042abcf98f1e61bde61d (patch)
treed35cf1d120f4610440bdbd1d30ace25e05f2cead /src
parentfbc7ff540c30e6734f87c19fe09197124fdcdabb (diff)
downloadrabbitmq-server-git-0646e9d9b74bbc430ea8042abcf98f1e61bde61d.tar.gz
adds default sync batch size on the app config
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_mirror_queue_misc.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rabbit_mirror_queue_misc.erl b/src/rabbit_mirror_queue_misc.erl
index 7b6c259e99..c68b799c7d 100644
--- a/src/rabbit_mirror_queue_misc.erl
+++ b/src/rabbit_mirror_queue_misc.erl
@@ -46,7 +46,7 @@
{enables, recovery}]}).
%% For compatibility with versions that don't support sync batching.
--define(DEFAULT_BATCH_SIZE, 1).
+-define(DEFAULT_BATCH_SIZE, 4096).
%%----------------------------------------------------------------------------
@@ -371,13 +371,17 @@ maybe_auto_sync(Q = #amqqueue{pid = QPid}) ->
sync_batch_size(#amqqueue{} = Q) ->
case policy(<<"ha-sync-batch-size">>, Q) of
none -> %% we need this case because none > 1 == true
- ?DEFAULT_BATCH_SIZE;
+ default_batch_size();
BatchSize when BatchSize > 1 ->
BatchSize;
_ ->
- ?DEFAULT_BATCH_SIZE
+ default_batch_size()
end.
+default_batch_size() ->
+ rabbit_misc:get_env(rabbit, mirroring_sync_batch_size,
+ ?DEFAULT_BATCH_SIZE).
+
update_mirrors(OldQ = #amqqueue{pid = QPid},
NewQ = #amqqueue{pid = QPid}) ->
case {is_mirrored(OldQ), is_mirrored(NewQ)} of