Skip to content

Commit

Permalink
Merge pull request #66 from zmstone/250113-fix-mnesia-schema-merge
Browse files Browse the repository at this point in the history
fix: merge nodes for external-copy cstruct
  • Loading branch information
zmstone authored Jan 14, 2025
2 parents 54a057a + a09f288 commit 5cb7cae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OTP_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26.2.5.2-2
26.2.5.2-3
8 changes: 7 additions & 1 deletion lib/mnesia/src/mnesia_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3673,7 +3673,13 @@ change_storage_type(N, disc_copies, Cs) ->
Cs#cstruct{disc_copies = mnesia_lib:uniq(Nodes)};
change_storage_type(N, disc_only_copies, Cs) ->
Nodes = [N | Cs#cstruct.disc_only_copies],
Cs#cstruct{disc_only_copies = mnesia_lib:uniq(Nodes)}.
Cs#cstruct{disc_only_copies = mnesia_lib:uniq(Nodes)};
change_storage_type(N, {ext, Alias, Mod}, Cs) ->
Key = {Alias, Mod},
{_, Nodes0} = lists:keyfind(Key, 1, Cs#cstruct.external_copies),
Nodes = mnesia_lib:uniq([N | Nodes0]),
ExternalCopies = lists:keyreplace(Key, 1, Cs#cstruct.external_copies, {Key, Nodes}),
Cs#cstruct{external_copies = ExternalCopies}.

%% BUGBUG: Verify match of frag info; equalit demanded for all but add_node

Expand Down

0 comments on commit 5cb7cae

Please sign in to comment.