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

feat: Add election service methods #13

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

feat: Add election service methods #13

wants to merge 12 commits into from

Conversation

rapsealk
Copy link
Member

@rapsealk rapsealk commented Jul 28, 2022

In this PR, Etcd's election service methods are added;

  • Campaign
  • Proclaim
  • Leader
  • Observe
  • Resign

This is for further implementation of Etcd-based leader election. I found that vote-based leader election is not a proper method in our case, since we have to ensure that manager cluster runs even the majority of managers are malfunctioning. Therefore, I think it would be better to use Etcd's election API since it provides a round-robinFIFO-like fashion.

References

@rapsealk rapsealk added the feature New feature or request label Jul 28, 2022
@rapsealk rapsealk requested a review from kyujin-cho July 28, 2022 08:31
@rapsealk rapsealk self-assigned this Jul 28, 2022
@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Attention: Patch coverage is 98.24561% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 54.09%. Comparing base (ced4a60) to head (df090e5).
Report is 30 commits behind head on main.

Files Patch % Lines
src/etcetra/types.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   50.16%   54.09%   +3.92%     
==========================================
  Files          36       36              
  Lines        2386     2442      +56     
==========================================
+ Hits         1197     1321     +124     
+ Misses       1189     1121      -68     

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

Copy link
Member

@kyujin-cho kyujin-cho left a comment

Choose a reason for hiding this comment

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

Please add test cases which covers newly created methods.

@@ -164,7 +164,7 @@ def main(version: str, repo_path: Optional[Path] = None):
parser.add_argument('version', type=str, help='target etcd version')
parser.add_argument(
'--repository-path', type=str,
help='git repository folder path of etcd source code to use. Ff not supplied, '
help='git repository folder path of etcd source code to use. If not supplied, '
Copy link
Member

Choose a reason for hiding this comment

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

Oops

@rapsealk rapsealk requested a review from kyujin-cho July 29, 2022 05:29
@rapsealk rapsealk requested a review from kyujin-cho July 29, 2022 08:26
Copy link
Member

@kyujin-cho kyujin-cho left a comment

Choose a reason for hiding this comment

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

Just a couple of minor feedbacks!

@kyujin-cho
Copy link
Member

@rapsealk One thing more: Please write down usage examples about new Election API on README.md.

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2023

CLA assistant check
All committers have signed the CLA.

@stalkerg
Copy link

@rapsealk @kyujin-cho, what is the status of this PR? Do you expect to merge it (after conflicts fixes)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants