diff options
author | Gabriele Santomaggio <g.santomaggio@gmail.com> | 2021-03-12 12:35:28 +0100 |
---|---|---|
committer | Gabriele Santomaggio <g.santomaggio@gmail.com> | 2021-03-12 12:35:28 +0100 |
commit | e75a0a61a61c327f3ec1c146c5e04a7950577fc8 (patch) | |
tree | 3dfefe71f1ccdc46ddfa6d4400c424f89ffa06d5 | |
parent | 7ce80c828e4a4e5ac090369c1593faedd9a550b8 (diff) | |
download | rabbitmq-server-git-dhl.tar.gz |
testdhl
-rw-r--r-- | deps/rabbit/src/rabbit_binding.erl | 23 | ||||
-rw-r--r-- | deps/rabbit/src/rabbit_vhost.erl | 12 |
2 files changed, 26 insertions, 9 deletions
diff --git a/deps/rabbit/src/rabbit_binding.erl b/deps/rabbit/src/rabbit_binding.erl index c254942a42..8b3fb1588e 100644 --- a/deps/rabbit/src/rabbit_binding.erl +++ b/deps/rabbit/src/rabbit_binding.erl @@ -80,7 +80,9 @@ new(Src, RoutingKey, Dst, Arguments) -> 'ok'. recover() -> - rabbit_log:info("[DHL] Start bindings recovering~n", []), +%% eprof:start(), +%% eprof:start_profiling([self()]), + rabbit_log:info("[DHL] Start bindings recovering: ~n ", []), R= rabbit_misc:table_filter( fun (Route) -> mnesia:read({rabbit_semi_durable_route, Route}) =:= [] @@ -90,7 +92,9 @@ recover() -> (_Route, false) -> ok end, rabbit_durable_route), - rabbit_log:info("[DHL] End bindings recovering ~n", []), + rabbit_log:info("[DHL] End bindings recovering2 ~n", []), +%% eprof:stop_profiling(), +%% rabbit_log:info("[DHL] End profile recovering ~s ~n", [eprof:analyze(total)]), R. @@ -109,16 +113,17 @@ recover(XNames, QNames) -> ok = gatherer:stop(Gatherer), ok. -recover_semi_durable_route(Gatherer, R = #route{binding = B}, ToRecover) -> +recover_semi_durable_route(_Gatherer, R = #route{binding = B}, ToRecover) -> #binding{source = Src, destination = Dst} = B, case sets:is_element(Dst, ToRecover) of true -> {ok, X} = rabbit_exchange:lookup(Src), - ok = gatherer:fork(Gatherer), - ok = worker_pool:submit_async( - fun () -> - recover_semi_durable_route_txn(R, X), - gatherer:finish(Gatherer) - end); +%% ok = gatherer:fork(Gatherer), + ok = recover_semi_durable_route_txn(R, X); +%% ok = worker_pool:submit_async( +%% fun () -> +%% recover_semi_durable_route_txn(R, X), +%% gatherer:finish(Gatherer) +%% end); false -> ok end. diff --git a/deps/rabbit/src/rabbit_vhost.erl b/deps/rabbit/src/rabbit_vhost.erl index 0e6a6a0204..a8e224a739 100644 --- a/deps/rabbit/src/rabbit_vhost.erl +++ b/deps/rabbit/src/rabbit_vhost.erl @@ -42,19 +42,31 @@ recover() -> ok. recover(VHost) -> +%% eprof:start(), +%% eprof:start_profiling([self()]), VHostDir = msg_store_dir_path(VHost), + rabbit_log:info("[DHL1] VHOST START bindings recovering: '~s' ~n ", [VHost]), rabbit_log:info("Making sure data directory '~ts' for vhost '~s' exists~n", [VHostDir, VHost]), VHostStubFile = filename:join(VHostDir, ".vhost"), ok = rabbit_file:ensure_dir(VHostStubFile), ok = file:write_file(VHostStubFile, VHost), + rabbit_log:info("[DHL1] VHOST STEP[1] bindings recovering: '~s' ~n ", [VHost]), {Recovered, Failed} = rabbit_amqqueue:recover(VHost), + rabbit_log:info("[DHL1] VHOST STEP[2] bindings recovering: '~s' ~n ", [VHost]), AllQs = Recovered ++ Failed, QNames = [amqqueue:get_name(Q) || Q <- AllQs], + rabbit_log:info("[DHL1] VHOST STEP[3] bindings recovering: '~s' ~n ", [VHost]), ok = rabbit_binding:recover(rabbit_exchange:recover(VHost), QNames), + rabbit_log:info("[DHL1] VHOST STEP[4] bindings recovering: '~s' ~n ", [VHost]), ok = rabbit_amqqueue:start(Recovered), + rabbit_log:info("[DHL1] VHOST STEP[5] bindings recovering: '~s' ~n ", [VHost]), %% Start queue mirrors. + rabbit_log:info("[DHL1] VHOST STEP[6] bindings recovering: '~s' ~n ", [VHost]), ok = rabbit_mirror_queue_misc:on_vhost_up(VHost), + rabbit_log:info("[DHL1] VHOST STOP bindings recovering:'~s' ~n ", [VHost]), +%% eprof:stop_profiling(), +%% rabbit_log:info("[DHL1] End profile recovering ~s ~n", [eprof:analyze(total)]), ok. -define(INFO_KEYS, vhost:info_keys()). |