Skip to content

Commit

Permalink
rabbit_mnesia_rename: Backup local tables only
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
dumbbell committed Aug 25, 2016
1 parent 2527a85 commit f43f6cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rabbit_mnesia_rename.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down

0 comments on commit f43f6cd

Please sign in to comment.