summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Fedotov <dfedotov@pivotal.io>2016-12-23 10:25:23 +0000
committerDaniil Fedotov <dfedotov@pivotal.io>2016-12-23 10:25:23 +0000
commit83d32221804d75ce0d6957a0886ae7a451e2a08b (patch)
treef619f93378012eb0e8b5672de79b3935204fcecb
parent79685d044aee1ec7c557660fbefbcede8d789338 (diff)
downloadrabbitmq-server-git-83d32221804d75ce0d6957a0886ae7a451e2a08b.tar.gz
Fix logs. Expect multiple logs during startup
-rw-r--r--src/rabbit_variable_queue.erl26
-rw-r--r--test/unit_inbroker_SUITE.erl6
2 files changed, 19 insertions, 13 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index dda7605969..3295da6b8d 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -508,12 +508,16 @@ start_msg_store(Refs, StartFunState) when is_map(Refs); Refs == undefined ->
?MSG_STORE_RESTORE_BATCH_SIZE),
in_batches(RestoreBatchSize,
{rabbit_variable_queue, add_vhost_msg_store, []},
- VHosts),
+ VHosts,
+ "Recovering batch ~p of ~p vhosts ~n",
+ "Batch ~p of ~p vhsots recovered ~n"),
ok.
add_vhost_msg_store(VHost) ->
+ rabbit_log:info("Starting message store vor vhost ~p~n", [VHost]),
rabbit_msg_store_vhost_sup:add_vhost(?TRANSIENT_MSG_STORE_SUP, VHost),
- rabbit_msg_store_vhost_sup:add_vhost(?PERSISTENT_MSG_STORE_SUP, VHost).
+ rabbit_msg_store_vhost_sup:add_vhost(?PERSISTENT_MSG_STORE_SUP, VHost),
+ rabbit_log:info("Message store is started vor vhost ~p~n", [VHost]).
stop_msg_store() ->
ok = rabbit_sup:stop_child(?PERSISTENT_MSG_STORE_SUP),
@@ -2761,7 +2765,9 @@ move_messages_to_vhost_store() ->
?QUEUE_MIGRATION_BATCH_SIZE),
in_batches(MigrationBatchSize,
{rabbit_variable_queue, migrate_queue, [OldStore, NewStoreSup]},
- QueuesWithTerms),
+ QueuesWithTerms,
+ "Migrating batch ~p of ~p queues ~n",
+ "Batch ~p of ~p queues migrated ~n"),
log_upgrade("Message store migration finished"),
delete_old_store(OldStore),
@@ -2770,16 +2776,16 @@ move_messages_to_vhost_store() ->
ok = rabbit_sup:stop_child(NewStoreSup),
ok.
-in_batches(Size, MFA, List) ->
- in_batches(Size, 1, MFA, List).
+in_batches(Size, MFA, List, MessageStart, MessageEnd) ->
+ in_batches(Size, 1, MFA, List, MessageStart, MessageEnd).
-in_batches(_, _, _, []) -> ok;
-in_batches(Size, BatchNum, MFA, List) ->
+in_batches(_, _, _, [], _, _) -> ok;
+in_batches(Size, BatchNum, MFA, List, MessageStart, MessageEnd) ->
{Batch, Tail} = case Size > length(List) of
true -> {List, []};
false -> lists:split(Size, List)
end,
- log_upgrade("Migrating batch ~p of ~p queues ~n", [BatchNum, Size]),
+ log_upgrade(MessageStart, [BatchNum, Size]),
{M, F, A} = MFA,
Keys = [ rpc:async_call(node(), M, F, [El | A]) || El <- Batch ],
lists:foreach(fun(Key) ->
@@ -2789,8 +2795,8 @@ in_batches(Size, BatchNum, MFA, List) ->
end
end,
Keys),
- log_upgrade("Batch ~p of ~p queues migrated ~n", [BatchNum, Size]),
- in_batches(Size, BatchNum + 1, MFA, Tail).
+ log_upgrade(MessageEnd, [BatchNum, Size]),
+ in_batches(Size, BatchNum + 1, MFA, Tail, MessageStart, MessageEnd).
migrate_queue({QueueName, RecoveryTerm}, OldStore, NewStoreSup) ->
log_upgrade_verbose(
diff --git a/test/unit_inbroker_SUITE.erl b/test/unit_inbroker_SUITE.erl
index 8e05faa4c3..98fb6ac3c2 100644
--- a/test/unit_inbroker_SUITE.erl
+++ b/test/unit_inbroker_SUITE.erl
@@ -1842,7 +1842,7 @@ log_management(Config) ->
?MODULE, log_management1, [Config]).
log_management1(_Config) ->
- [LogFile] = rabbit:log_locations(),
+ [LogFile|_] = rabbit:log_locations(),
Suffix = ".0",
ok = test_logs_working([LogFile]),
@@ -1917,7 +1917,7 @@ log_management_during_startup(Config) ->
?MODULE, log_management_during_startup1, [Config]).
log_management_during_startup1(_Config) ->
- [LogFile] = rabbit:log_locations(),
+ [LogFile|_] = rabbit:log_locations(),
Suffix = ".0",
%% start application with simple tty logging
@@ -2002,7 +2002,7 @@ externally_rotated_logs_are_automatically_reopened(Config) ->
?MODULE, externally_rotated_logs_are_automatically_reopened1, [Config]).
externally_rotated_logs_are_automatically_reopened1(_Config) ->
- [LogFile] = rabbit:log_locations(),
+ [LogFile|_] = rabbit:log_locations(),
%% Make sure log file is opened
ok = test_logs_working([LogFile]),