summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Watson <tim@rabbitmq.com>2013-12-17 17:34:18 +0000
committerTim Watson <tim@rabbitmq.com>2013-12-17 17:34:18 +0000
commit2debc45865fcbb4c37847eeb9f510868988effd4 (patch)
tree14bcb28fb2ba707aa71e18945bd8321b20c2cf06 /src
parented96d17433b5ca3c9add19c91117ae1648072e9a (diff)
downloadrabbitmq-server-git-2debc45865fcbb4c37847eeb9f510868988effd4.tar.gz
Ensure old clean.dot files are removed during recovery
We also ignore the .dets index file whilst processing the old shutdown term files, since the names no longer match. If file deletion fails, we log the filename and posix error.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_recovery_indexes.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rabbit_recovery_indexes.erl b/src/rabbit_recovery_indexes.erl
index 2890b2f385..5ad6b925d2 100644
--- a/src/rabbit_recovery_indexes.erl
+++ b/src/rabbit_recovery_indexes.erl
@@ -76,8 +76,15 @@ upgrade_recovery_indexes() ->
fun(F, Acc) -> [F|Acc] end, []),
[begin
{ok, Terms} = rabbit_file:read_term_file(File),
- ok = store_recovery_terms(File, Terms)
- end || File <- lists:delete(dets_filename(), DotFiles)],
+ ok = store_recovery_terms(File, Terms),
+ case file:delete(File) of
+ {error, E} ->
+ rabbit_log:warning("Unable to delete recovery index"
+ "~s during upgrade: ~p~n", [File, E]);
+ ok ->
+ ok
+ end
+ end || File <- DotFiles],
ok
after
flush()