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: introduce the peer state #2649

Closed
wants to merge 1 commit into from

Conversation

WenyXu
Copy link
Member

@WenyXu WenyXu commented Oct 24, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Introduces the peer state. By default, the peer's state is None.

We should downgrade a Peer before deactivating a Region on it:

  • During the Region Failover Procedure (Region on the Peer is unavailable).
  • Migrating a Region (Region on the Peer was planned to migrate to another Peer).

Notes: Meta Server will stop renewing the lease for a Region on the downgraded Peer.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

#2638

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #2649 (a7e432a) into develop (01fdbf3) will decrease coverage by 0.36%.
Report is 1 commits behind head on develop.
The diff coverage is 94.28%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2649      +/-   ##
===========================================
- Coverage    84.90%   84.54%   -0.36%     
===========================================
  Files          743      743              
  Lines       120672   120704      +32     
===========================================
- Hits        102455   102050     -405     
- Misses       18217    18654     +437     

@MichaelScofield
Copy link
Collaborator

If some regions on a peer are under migration while others stay active, will this peer be marked as "downgraded"?

@WenyXu
Copy link
Member Author

WenyXu commented Oct 26, 2023

If some regions on a peer are under migration while others stay active, will this peer be marked as "downgraded"?

Nope, only region level downgrading.

@MichaelScofield
Copy link
Collaborator

If some regions on a peer are under migration while others stay active, will this peer be marked as "downgraded"?

Nope, only region level downgrading.

So you will set a peer's state to "downgraded" only when all the regions on it are under migration or deactivated?

@WenyXu
Copy link
Member Author

WenyXu commented Oct 26, 2023

So you will set a peer's state to "downgraded" only when all the regions on it are under migration or deactivated?

Oh, My bad.

If some regions on a peer are under migration while others stay active, will this peer be marked as "downgraded"?

The answer to this should be Yes. However, it might make the thing tricky... What if, most of the time, the crash happened at the Peer level? It might need to update lots of TableRoutes.

@WenyXu WenyXu marked this pull request as draft October 26, 2023 11:16
@WenyXu WenyXu closed this Oct 31, 2023
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