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

Pause on all nodes during join #46

Merged
merged 15 commits into from
Jan 4, 2024
Merged

Pause on all nodes during join #46

merged 15 commits into from
Jan 4, 2024

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Dec 23, 2023

To avoid race conditions we have to pause on all nodes.

The issue:

  • if join coordinator node looses connection with one of the nodes during join, that node gets unpaused.
  • when unpaused, the node would start sending remote ops and check_server requests.
  • there is a chance that other nodes in cluster would receive the messages before send_dump.

I've tried to show the errors in tests.

Solution:

  • we could delay the messages by unpausing only when all nodes receive DOWN from the cets_join process.

Adresses MIM-2137

Add send_check_servers_is_called_before_last_server_got_dump case
Delay check_server call
Pause from all nodes during the join
To avoid unpausing some nodes when they loose connection with the coordinator
(but coordinator is still alive)
Aggressive pausing would ensure that check_server is only sent after cets_join
sent all the send_dump messages
Reformat update_node_down_history
Copy link

codecov bot commented Dec 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0e3f83e) 98.26% compared to head (6a49936) 98.32%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   98.26%   98.32%   +0.06%     
==========================================
  Files          10       10              
  Lines         750      778      +28     
==========================================
+ Hits          737      765      +28     
  Misses         13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

arcusfelis added a commit to esl/MongooseIM that referenced this pull request Dec 23, 2023
arcusfelis added a commit to esl/MongooseIM that referenced this pull request Dec 24, 2023
@arcusfelis arcusfelis marked this pull request as ready for review December 29, 2023 13:12
Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

I reviewed what I could understand. The test suite becomes huge and I have no idea how you don't get lost in the test cases - I did. I still don't get the cause of the original issue though, so I really can't evaluate the fix.

src/cets.erl Outdated Show resolved Hide resolved
test/cets_SUITE.erl Outdated Show resolved Hide resolved
test/cets_SUITE.erl Outdated Show resolved Hide resolved
test/cets_SUITE.erl Outdated Show resolved Hide resolved
test/cets_SUITE.erl Outdated Show resolved Hide resolved
src/cets_join.erl Outdated Show resolved Hide resolved
src/cets_join.erl Outdated Show resolved Hide resolved
src/cets_join.erl Outdated Show resolved Hide resolved
src/cets_join.erl Show resolved Hide resolved
src/cets_join.erl Show resolved Hide resolved
@chrzaszcz
Copy link
Member

After a discussion with @arcusfelis I understand the current solution, and it seems good enough for now. We just need to address the remaining comments.

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@chrzaszcz chrzaszcz merged commit 7eca9e9 into main Jan 4, 2024
8 checks passed
@chrzaszcz chrzaszcz deleted the delayed-check-servers branch January 4, 2024 10:55
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.

2 participants