Skip to content

feat(procedure): Add procedure watcher#1043

Merged
killme2008 merged 5 commits intoGreptimeTeam:developfrom
evenyag:feat/procedure-watch
Feb 21, 2023
Merged

feat(procedure): Add procedure watcher#1043
killme2008 merged 5 commits intoGreptimeTeam:developfrom
evenyag:feat/procedure-watch

Conversation

@evenyag
Copy link
Copy Markdown
Contributor

@evenyag evenyag commented Feb 20, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Add a Watcher to watch the procedure state. Callers can use this watcher to wait until the procedure is done.

Also refactor the runner. Now it uses RAII style to ensure the lock is released and the procedure is clean up.

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 marked this pull request as ready for review February 20, 2023 09:04
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 20, 2023

Codecov Report

Merging #1043 (b32953b) into develop (4bbad6a) will decrease coverage by 0.12%.
The diff coverage is 96.24%.

@@             Coverage Diff             @@
##           develop    #1043      +/-   ##
===========================================
- Coverage    85.79%   85.67%   -0.12%     
===========================================
  Files          446      446              
  Lines        64848    64907      +59     
===========================================
- Hits         55635    55612      -23     
- Misses        9213     9295      +82     
Flag Coverage Δ
rust 85.67% <96.24%> (-0.12%) ⬇️

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

Impacted Files Coverage Δ
src/common/procedure/src/lib.rs 100.00% <ø> (ø)
src/common/procedure/src/procedure.rs 90.09% <ø> (ø)
src/common/procedure/src/local.rs 92.49% <95.14%> (+0.74%) ⬆️
src/common/procedure/src/local/runner.rs 82.87% <100.00%> (+0.76%) ⬆️
src/object-store/src/test_util.rs 0.00% <0.00%> (-100.00%) ⬇️
src/datanode/src/instance.rs 43.77% <0.00%> (-14.34%) ⬇️
tests-integration/src/test_util.rs 79.08% <0.00%> (-9.51%) ⬇️
src/frontend/src/table/scan.rs 85.18% <0.00%> (-5.56%) ⬇️
src/servers/src/mysql/handler.rs 68.14% <0.00%> (-1.49%) ⬇️
src/common/substrait/src/df_expr.rs 30.16% <0.00%> (-0.66%) ⬇️
... and 5 more

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

Comment thread src/common/procedure/src/local/runner.rs
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

@killme2008 killme2008 merged commit c6f2db8 into GreptimeTeam:develop Feb 21, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* refactor: Use watch channel to store ProcedureState

* feat: Add a watcher to wait for state change

* test: test watcher on procedure failure

* feat: Only clear message cache on success

* feat: submit returns Watcher
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