diff options
Diffstat (limited to 'lib/mnesia/src/mnesia_tm.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_tm.erl | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl index c7a0c28589..0b87c40add 100644 --- a/lib/mnesia/src/mnesia_tm.erl +++ b/lib/mnesia/src/mnesia_tm.erl @@ -1259,23 +1259,15 @@ needs_majority(Tab, #prep{majority = M}) -> false -> [{Tab, []} | M]; true -> - CopyHolders = all_copy_holders(Tab), + CopyHolders = val({Tab, all_nodes}), [{Tab, CopyHolders} | M] end end. -all_copy_holders(Tab) -> - DC = val({Tab, disc_copies}), - DO = val({Tab, disc_only_copies}), - RC = val({Tab, ram_copies}), - DC ++ DO ++ RC. - have_majority([], _) -> ok; have_majority([{Tab, AllNodes} | Rest], Nodes) -> - Missing = AllNodes -- Nodes, - Present = AllNodes -- Missing, - case length(Present) > length(Missing) of + case mnesia_lib:have_majority(Tab, AllNodes, Nodes) of true -> have_majority(Rest, Nodes); false -> |