diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-06-04 18:37:23 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-06-04 18:37:23 +0100 |
| commit | 0a49575d4ab92e27b2b8633e0425419e1f1e112c (patch) | |
| tree | eec9f6ff067550eb73b1521caab45eab8284ca9f /src/rabbit.erl | |
| parent | c310db59b9098ff7632c0f4ddaf736df59ef5646 (diff) | |
| download | rabbitmq-server-git-0a49575d4ab92e27b2b8633e0425419e1f1e112c.tar.gz | |
Queue recovery on startup now works.
o) All queues start up and ask the disk_queue for their contents
o) Post durable-queue-recovery, the main rabbit process tells the disk queue to delete the contents of any other queues which have not been found as persistent.
Diffstat (limited to 'src/rabbit.erl')
| -rw-r--r-- | src/rabbit.erl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index e79c7f5936..ce73f6ce6d 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -145,17 +145,21 @@ start(normal, []) -> ok = start_child(rabbit_router), ok = start_child(rabbit_node_monitor) end}, - {"recovery", - fun () -> - ok = maybe_insert_default_data(), - ok = rabbit_exchange:recover(), - ok = rabbit_amqqueue:recover() - end}, {"disk queue", fun () -> ok = start_child(rabbit_disk_queue), ok = rabbit_disk_queue:to_ram_disk_mode() %% TODO, CHANGE ME end}, + {"recovery", + fun () -> + ok = maybe_insert_default_data(), + ok = rabbit_exchange:recover(), + {ok, DurableQueues} = rabbit_amqqueue:recover(), + DurableQueueNames = + sets:from_list(lists:map( + fun(Q) -> Q #amqqueue.name end, DurableQueues)), + ok = rabbit_disk_queue:delete_non_durable_queues(DurableQueueNames) + end}, {"guid generator", fun () -> ok = start_child(rabbit_guid) |
