summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2016-08-25 17:49:49 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2016-08-25 17:49:49 +0200
commitf43f6cd6133c57aeb814b2c4e6998b1a89beb7d5 (patch)
tree226f54ac75b5f7bbfc35a6b73151058d1d2a22d9
parent2527a853a27595915edcb736dbe35cd56fb067a2 (diff)
downloadrabbitmq-server-git-f43f6cd6133c57aeb814b2c4e6998b1a89beb7d5.tar.gz
rabbit_mnesia_rename: Backup local tables only
The connection tracking tables are not replicated because the table tracking connections on node A logically exists only the node A. The backup made during the rename of a node failed because it wanted to access a remote offline node to backup its connection tracking tables. Obviously it didn't work. The solution is to not backup those tables. This is correct because they are only relevant while the node is running. References #500. [#116521809]
-rw-r--r--src/rabbit_mnesia_rename.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_mnesia_rename.erl b/src/rabbit_mnesia_rename.erl
index 0945e31522..0c3e7c2366 100644
--- a/src/rabbit_mnesia_rename.erl
+++ b/src/rabbit_mnesia_rename.erl
@@ -124,7 +124,13 @@ prepare(Node, NodeMapList) ->
take_backup(Backup) ->
start_mnesia(),
- ok = mnesia:backup(Backup),
+ %% We backup only local tables: in particular, this excludes the
+ %% connection tracking tables which have no local replica.
+ LocalTables = mnesia:system_info(local_tables),
+ {ok, Name, _Nodes} = mnesia:activate_checkpoint([
+ {max, LocalTables}
+ ]),
+ ok = mnesia:backup_checkpoint(Name, Backup),
stop_mnesia().
restore_backup(Backup) ->