Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the situation when one of the core nodes leaves the cluster #123

Merged
merged 6 commits into from
Feb 28, 2023

Conversation

ieQu1
Copy link
Member

@ieQu1 ieQu1 commented Feb 27, 2023

Prior to this fix, the LB got pretty much stuck any time it detected a split in the core cluster.
Now it does the following:

  • Collects mnesia cluster view from all discovered core nodes
  • If the core cluster is partitioned, it tries to stick to a single partition, which is selected according to the following heuristics:
    • It contains most of the old core nodes
    • In case of a tie, it picks the biggest partition

test/mria_ct.erl Show resolved Hide resolved
@ieQu1 ieQu1 requested a review from thalesmg February 27, 2023 18:43
src/mria_lb.erl Outdated Show resolved Hide resolved
src/mria_lb.erl Outdated Show resolved Hide resolved
test/mria_lb_SUITE.erl Outdated Show resolved Hide resolved
src/mria_lb.erl Show resolved Hide resolved
test/mria_lb_SUITE.erl Outdated Show resolved Hide resolved
ieQu1 and others added 2 commits February 27, 2023 21:06
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
Co-authored-by: Thales Macedo Garitezi <thalesmg@gmail.com>
zmstone
zmstone previously approved these changes Feb 28, 2023
@ieQu1 ieQu1 merged commit 80625f5 into emqx:main Feb 28, 2023
@@ -260,10 +280,10 @@ with_reported_cores(Node, CoresToReport, TestFun) ->

with_role(Node, Role, TestFun) ->
ok = erpc:call(Node, meck, new, [mria_rlog, [passthrough, no_history, no_link]]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be mria_config now?

Suggested change
ok = erpc:call(Node, meck, new, [mria_rlog, [passthrough, no_history, no_link]]),
ok = erpc:call(Node, meck, new, [mria_config, [passthrough, no_history, no_link]]),

src/mria_lb.erl Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants