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 region lease keeper #2645

Merged

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 new region lease keeper, which utilizes the LeaderCachedKvStore.

The find_staled_leader_regions method, returns staled Leader regions:

  • It returns a region if the datanode_id isn't the corresponding leader peer in region_routes.
    • Expected as RegionRole::Follower regions.
    • Unexpected RegionRole::Leader regions.
  • It returns a region if the region's table metadata is not found.

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)

#2636

@WenyXu WenyXu force-pushed the feat/region-lease-keeper branch 3 times, most recently from f300245 to f3dbbad Compare October 24, 2023 05:16
@WenyXu WenyXu marked this pull request as ready for review October 24, 2023 05:18
@WenyXu WenyXu mentioned this pull request Oct 24, 2023
3 tasks
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #2645 (32ec24d) into develop (479ffe5) will decrease coverage by 0.38%.
The diff coverage is 92.89%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2645      +/-   ##
===========================================
- Coverage    85.10%   84.73%   -0.38%     
===========================================
  Files          754      758       +4     
  Lines       120911   121219     +308     
===========================================
- Hits        102902   102710     -192     
- Misses       18009    18509     +500     

@WenyXu WenyXu force-pushed the feat/region-lease-keeper branch 2 times, most recently from 45ddd84 to 4e1778e Compare October 24, 2023 06:18
src/common/meta/src/rpc/router.rs Outdated Show resolved Hide resolved
src/meta-srv/src/region/lease_keeper.rs Outdated Show resolved Hide resolved
src/meta-srv/src/region/lease_keeper/mito.rs Outdated Show resolved Hide resolved
@WenyXu WenyXu force-pushed the feat/region-lease-keeper branch 2 times, most recently from bce0879 to 6eb8658 Compare October 24, 2023 15:28
@WenyXu WenyXu marked this pull request as draft October 27, 2023 08:29
@WenyXu WenyXu marked this pull request as ready for review October 31, 2023 06:07
@WenyXu
Copy link
Member Author

WenyXu commented Oct 31, 2023

@MichaelScofield @fengjiachun PTAL

src/common/meta/src/rpc/router.rs Outdated Show resolved Hide resolved
src/common/meta/src/rpc/router.rs Outdated Show resolved Hide resolved
src/common/meta/src/rpc/router.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@WenyXu WenyXu marked this pull request as draft October 31, 2023 08:48
@WenyXu WenyXu marked this pull request as ready for review October 31, 2023 08:55
src/common/meta/src/rpc/router.rs Outdated Show resolved Hide resolved
src/meta-srv/src/region/lease_keeper.rs Outdated Show resolved Hide resolved
@WenyXu
Copy link
Member Author

WenyXu commented Nov 2, 2023

@MichaelScofield PTAL

@MichaelScofield MichaelScofield added this pull request to the merge queue Nov 2, 2023
Merged via the queue into GreptimeTeam:develop with commit ce867fb Nov 2, 2023
14 checks passed
@WenyXu WenyXu mentioned this pull request Nov 6, 2023
39 tasks
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.

3 participants