Skip to content

feat: Implement LocalManager::recover#981

Merged
v0y4g3r merged 2 commits intoGreptimeTeam:developfrom
evenyag:feat/procedure-recover
Feb 14, 2023
Merged

feat: Implement LocalManager::recover#981
v0y4g3r merged 2 commits intoGreptimeTeam:developfrom
evenyag:feat/procedure-recover

Conversation

@evenyag
Copy link
Copy Markdown
Contributor

@evenyag evenyag commented Feb 13, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR implements LocalManager::recover that recover uncommitted procedures from ProcedureStore and re-submits them to execute.

Recovery

  • LocalManager loads messages of all uncommitted procedures from ProcedureStore and caches in memory.
  • Instead of recovering each subprocedures, LocalManager just submit the root procedure to execute.
  • Because each step of the procedure is idempotent, the root procedure should submits its subprocedures again.
  • Then the manager can load the subprocedure from the cached message by the procedure id.
  • Once the root procedure is finished, we can remove the cached message from the manager.

This simplify the recover process a lot as we don't need to reconstruct the whole DAG.

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)

@evenyag evenyag force-pushed the feat/procedure-recover branch from 93b6118 to b88e3ea Compare February 13, 2023 08:27
@evenyag evenyag marked this pull request as ready for review February 13, 2023 09:37
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 13, 2023

Codecov Report

Merging #981 (29952d4) into develop (c1a9f84) will decrease coverage by 0.09%.
The diff coverage is 90.65%.

@@             Coverage Diff             @@
##           develop     #981      +/-   ##
===========================================
- Coverage    85.74%   85.65%   -0.09%     
===========================================
  Files          461      461              
  Lines        62932    62982      +50     
===========================================
- Hits         53962    53949      -13     
- Misses        8970     9033      +63     
Flag Coverage Δ
rust 85.65% <90.65%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/procedure/src/local.rs 91.68% <89.36%> (+5.65%) ⬆️
src/common/procedure/src/local/runner.rs 82.30% <100.00%> (+0.02%) ⬆️
src/common/procedure/src/store.rs 96.35% <100.00%> (+0.04%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
src/datanode/src/instance.rs 41.56% <0.00%> (-14.91%) ⬇️
tests-integration/src/test_util.rs 79.47% <0.00%> (-9.33%) ⬇️
src/servers/src/error.rs 37.93% <0.00%> (-6.90%) ⬇️
src/servers/src/grpc.rs 86.95% <0.00%> (-4.35%) ⬇️
src/servers/src/opentsdb.rs 96.82% <0.00%> (-1.59%) ⬇️
src/meta-srv/src/service/heartbeat.rs 86.17% <0.00%> (-1.07%) ⬇️
... and 4 more

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

Copy link
Copy Markdown
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

@v0y4g3r v0y4g3r merged commit 0f7e5a2 into GreptimeTeam:develop Feb 14, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: Implement LocalManager::recover

* feat: Impl From<ObjectStore> for ProcedureStore
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