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

Add Leader Election for Housekeeping in Sharded Cluster using K8s Lease #521

Closed
wants to merge 2 commits into from

Conversation

krapie
Copy link
Member

@krapie krapie commented Apr 24, 2023

What this PR does / why we need it:

Add leader election for housekeeping in sharded cluster.

  • server/backend/election package is added for leader election, and it uses K8s client-go's leaderelection package to simplify implementation of leader election.
  • yorkie-cluster Helm Chart is configured to support leader election between yorkie servers, with K8s Lease object.
  • Also, small error in hostname value in server/backend/backend.go is fixed. For more information, follow: Add user agent metrics PR

Which issue(s) this PR fixes:

Fixes #505

Special notes for your reviewer:

Yorkie server will have K8s dependency when using leader election in cluster mode, but since cluster mode is already dependent on K8s, including K8s dependent code will be okay.

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@krapie krapie added the enhancement 🌟 New feature or request label Apr 24, 2023
@krapie krapie requested a review from hackerwins April 24, 2023 16:11
@krapie krapie self-assigned this Apr 24, 2023
@krapie krapie force-pushed the shard-cluster-housekeeping branch from 6f9ed44 to 5f6191a Compare April 24, 2023 16:12
@krapie krapie mentioned this pull request Apr 24, 2023
2 tasks
@krapie krapie changed the title Add Leader Election for Housekeeping in Shard Cluster Add Leader Election for Housekeeping in Sharded Cluster Apr 24, 2023
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #521 (6f9ed44) into main (969e509) will decrease coverage by 0.12%.
The diff coverage is 5.88%.

❗ Current head 6f9ed44 differs from pull request most recent head 5f6191a. Consider uploading reports for the commit 5f6191a to get more accurate results

@@            Coverage Diff             @@
##             main     #521      +/-   ##
==========================================
- Coverage   50.61%   50.50%   -0.12%     
==========================================
  Files          64       64              
  Lines        5751     5766      +15     
==========================================
+ Hits         2911     2912       +1     
- Misses       2471     2484      +13     
- Partials      369      370       +1     
Impacted Files Coverage Δ
server/backend/backend.go 0.00% <0.00%> (ø)
server/backend/config.go 55.55% <ø> (ø)
server/config.go 43.01% <33.33%> (-0.33%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@krapie krapie changed the title Add Leader Election for Housekeeping in Sharded Cluster Add Leader Election for Housekeeping in Sharded Cluster using K8s May 3, 2023
@krapie krapie changed the title Add Leader Election for Housekeeping in Sharded Cluster using K8s Add Leader Election for Housekeeping in Sharded Cluster using K8s Lease May 3, 2023
@hackerwins
Copy link
Member

Since we plan to continue this with #529, I will close this PR.

@hackerwins hackerwins closed this May 19, 2023
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.

Handle housekeeping with sharded cluster
2 participants