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

khepri_cluster: Stop spamming cluster with join/leave if it is not ready #295

Merged

Conversation

dumbbell
Copy link
Member

Why

If a cluster change (a member joining or leaving), it is not permitted to make another change: Ra will reply with the following error:

{error, cluster_change_not_permitted}

Before this patch, we would retry immediately after such an error. We were effeclively spamming the Ra server with many join/leave commands, but the user too with hundreds of "not ready; waiting..." log messages.

How

For now, we simply add a hard-coded 200 ms sleep before retrying.

[Why]
If a cluster change (a member joining or leaving), it is not permitted
to make another change: Ra will reply with the following error:

    {error, cluster_change_not_permitted}

Before this patch, we would retry immediately after such an error. We
were effeclively spamming the Ra server with many join/leave commands,
but the user too with hundreds of "not ready; waiting..." log messages.

[How]
For now, we simply add a hard-coded 200 ms sleep before retrying.
@dumbbell dumbbell added the enhancement New feature or request label Sep 11, 2024
@dumbbell dumbbell added this to the v0.16.0 milestone Sep 11, 2024
@dumbbell dumbbell self-assigned this Sep 11, 2024
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.64%. Comparing base (80ef2a3) to head (99b5217).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   89.59%   89.64%   +0.04%     
==========================================
  Files          21       21              
  Lines        3192     3195       +3     
==========================================
+ Hits         2860     2864       +4     
+ Misses        332      331       -1     
Flag Coverage Δ
erlang-25 88.60% <83.33%> (-0.18%) ⬇️
erlang-26 89.51% <100.00%> (+0.13%) ⬆️
erlang-27 89.57% <100.00%> (+0.16%) ⬆️
os-ubuntu-latest 89.64% <100.00%> (+0.04%) ⬆️
os-windows-latest 89.35% <83.33%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@dumbbell dumbbell marked this pull request as ready for review September 11, 2024 17:20
@dumbbell dumbbell merged commit 2d04459 into main Sep 11, 2024
12 checks passed
@dumbbell dumbbell deleted the stop-spamming-with-cluster-change-commands-if-cluster-not-ready branch September 11, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants