feat(autoheal): compute heal plan for overlapping partitions#211
Open
keynslug wants to merge 4 commits into
Open
feat(autoheal): compute heal plan for overlapping partitions#211keynslug wants to merge 4 commits into
keynslug wants to merge 4 commits into
Conversation
This commit reworks the heal plan computation algorithm to work in environments where overlapping partitions are permitted, while keeping it functionally equivalent otherwise. The algorithm is essentially: smallest set of nodes directly connected to any partitioned nodes must be healed, i.e. must reboot and rejoin the cluster.
efa38b3 to
d7de9d5
Compare
This commit changes heal plan algorithm to instead consider fully connected sub-clusters in (potentially overlapping) cluster cliques computed from cluster partitions. This, for example, improves plans for situations where only a single link between 2 nodes is broken: only those 2 nodes will be asked to rejoin.
d7de9d5 to
3ef4d38
Compare
ieQu1
reviewed
May 13, 2026
| %% Enumerate cliques in the graph. | ||
| %% Graph is undirected, edge is considered to exist if 2 vertices have each other in | ||
| %% adjacency lists. | ||
| -spec find_cliques(#{V => [V]}) -> [[V]]. |
Member
There was a problem hiding this comment.
Some code in mria_autoheal uses ordset functions on the cliques, without transformation from lists. I guess it should be
Suggested change
| -spec find_cliques(#{V => [V]}) -> [[V]]. | |
| -spec find_cliques(#{V => [V]}) -> [ordsets:ordset(V)]. |
then?
ieQu1
reviewed
May 13, 2026
| -spec coordinator([node()]) -> node(). | ||
| coordinator(Candidates) -> | ||
| case lists:member(node(), Candidates) of | ||
| true -> node(); |
Member
There was a problem hiding this comment.
This is likely to create conflicts, since multiple nodes are likely to appoint themselves as coordinators.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR reworks the heal plan computation algorithm to produce correct outcomes in environments where overlapping partitions are permitted, while keeping it functionally equivalent to the existing one otherwise. When overlapping partitions are involved, the goal now is to compute largest fully connected sub-cluster over overlapping partitions.
Addresses EMQX-14176.