From 9818fcc0b899c7d19f017dc3059a5c5f4b0b450c Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 8 Aug 2018 12:14:40 +0200 Subject: Do NOT disc_load from ram_copies when master_node is set Setting master_nodes to a node with ram_copies replica and that node had not loaded the table, could cause it load an empty table, even though (non master) nodes had disc_replicas. This meant that tables where unexpected empty after multiple failures happened. When this happen do not load the table and wait for user to force_load it on some node, preferably with a disk copy. --- lib/mnesia/src/mnesia_controller.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/mnesia/src') diff --git a/lib/mnesia/src/mnesia_controller.erl b/lib/mnesia/src/mnesia_controller.erl index 77013489b3..7a592f25f9 100644 --- a/lib/mnesia/src/mnesia_controller.erl +++ b/lib/mnesia/src/mnesia_controller.erl @@ -1456,7 +1456,8 @@ orphan_tables([Tab | Tabs], Node, Ns, Local, Remote) -> L = [Tab | Local], orphan_tables(Tabs, Node, Ns, L, Remote); Masters -> - R = [{Tab, Masters} | Remote], + %% Do not disc_load table from RamCopyHolders + R = [{Tab, Masters -- RamCopyHolders} | Remote], orphan_tables(Tabs, Node, Ns, Local, R) end; _ -> -- cgit v1.2.3