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 invalidate cache step #1658

Merged

Conversation

WenyXu
Copy link
Member

@WenyXu WenyXu commented May 27, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Add invalidate cache step.

///                       ┌───────────────────┐
///                       │RegionFailoverStart│
///                       └─────────┬─────────┘
///                                 │
///                                 │ Selects a candidate(Datanode)
///                  ┌─────────┐    │ to place the failed region
///                  │         │    │
///  If replied with │     ┌───▼────▼───────┐
///  "Close region   │     │DeactivateRegion│
///  failed"         │     └───┬────┬───────┘
///                  │         │    │
///                  └─────────┘    │ Sends "Close Region" request
///                                 │ to the failed Datanode, and
///                  ┌─────────┐    │ wait for 2 seconds
///                  │         │    │
///                  │      ┌──▼────▼──────┐
/// Wait candidate   │      │ActivateRegion◄───────────────────────┐
/// response timeout │      └──┬────┬──────┘                       │
///                  │         │    │                              │
///                  └─────────┘    │ Sends "Open Region" request  │
///                                 │ to the candidate Datanode,   │
///                                 │ and wait for 30 seconds      │
///                                 │                              │
///                                 │ Check Datanode returns       │
///                                 │                              │
///                         success ├──────────────────────────────┘
///                                 │                       failed
///                       ┌─────────▼──────────┐
///                       │UpdateRegionMetadata│
///                       └─────────┬──────────┘
///                                 │
///                                 │ Updates the Region
///                                 │ placement metadata
///                                 │
///                         ┌───────▼───────┐
///                         │InvalidateCache│
///                         └───────┬───────┘
///                                 │
///                                 │ Broadcast Invalidate Table
///                                 │ Cache
///                                 │
///                                 │
///                        ┌────────▼────────┐
///                        │RegionFailoverEnd│
///                        └─────────────────┘

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)

#1126

@WenyXu WenyXu force-pushed the feat/invalidate_cache_procedure branch 2 times, most recently from 1ee8e1f to 1601b4e Compare May 27, 2023 10:49
@codecov
Copy link

codecov bot commented May 27, 2023

Codecov Report

Merging #1658 (d3e2687) into develop (ab5dfd3) will decrease coverage by 0.29%.
The diff coverage is 91.86%.

@@             Coverage Diff             @@
##           develop    #1658      +/-   ##
===========================================
- Coverage    85.73%   85.44%   -0.29%     
===========================================
  Files          571      572       +1     
  Lines        91615    91735     +120     
===========================================
- Hits         78546    78387     -159     
- Misses       13069    13348     +279     

src/common/meta/src/instruction.rs Show resolved Hide resolved
src/meta-srv/src/handler.rs Outdated Show resolved Hide resolved
@WenyXu WenyXu marked this pull request as draft May 29, 2023 09:38
auto-merge was automatically disabled May 29, 2023 09:38

Pull request was converted to draft

@WenyXu WenyXu force-pushed the feat/invalidate_cache_procedure branch from 519248d to b0409a3 Compare May 29, 2023 10:58
@WenyXu WenyXu marked this pull request as ready for review May 29, 2023 11:26
Copy link
Collaborator

@MichaelScofield MichaelScofield left a comment

Choose a reason for hiding this comment

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

Please resolve the conflicts.

src/meta-srv/src/procedure/region_failover.rs Outdated Show resolved Hide resolved
@WenyXu WenyXu force-pushed the feat/invalidate_cache_procedure branch from dcc05e7 to d3e2687 Compare May 30, 2023 02:21
@WenyXu
Copy link
Member Author

WenyXu commented May 30, 2023

PTAL @MichaelScofield

@MichaelScofield MichaelScofield enabled auto-merge (squash) May 30, 2023 02:27
@WenyXu
Copy link
Member Author

WenyXu commented May 30, 2023

PTAL @fengjiachun @killme2008

Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaelScofield MichaelScofield merged commit a4b8844 into GreptimeTeam:develop May 30, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: add invalidate cache step

* refactor: refactor TableIdent

* chore: apply suggestions from CR
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.

4 participants