-
Notifications
You must be signed in to change notification settings - Fork 25
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
[close #343]fix cdc residue metrics #342
Conversation
Signed-off-by: zeminzhou <[email protected]>
/unit_test_in_verify_ci |
cdc/cdc/owner/owner.go
Outdated
@@ -199,6 +199,14 @@ func (o *Owner) Tick(stdCtx context.Context, rawState orchestrator.ReactorState) | |||
return state, nil | |||
} | |||
|
|||
// Close try to close the owner when the owner is not running. | |||
// Note: This method must not be called with `Tick`. Please be careful. | |||
func (o *Owner) Close(ctx cdcContext.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to name as CloseAllCaptures
, as we are not closing Owner
here.
Here has similar code block, suggest to reuse this function.
(And maybe we also need the wrapper of context.)
At last, we need to double check about the thread-safety.
cdc/cdc/processor/manager.go
Outdated
@@ -155,6 +155,14 @@ func (m *Manager) sendCommand(tp commandTp, payload interface{}) chan struct{} { | |||
return cmd.done | |||
} | |||
|
|||
// Close closes all processors. | |||
// Note: This method must not be called with `Tick`. Please be careful. | |||
func (m *Manager) Close() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to name as SyncClose
, and reuse in handling of commandTpClose
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: zeminzhou <[email protected]>
Signed-off-by: zeminzhou <[email protected]>
/run-unit-test |
1 similar comment
/run-unit-test |
Signed-off-by: zeminzhou <[email protected]>
/run-integration-test |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #342 +/- ##
================================================
- Coverage 61.0648% 60.9127% -0.1521%
================================================
Files 240 240
Lines 20285 20334 +49
================================================
- Hits 12387 12386 -1
- Misses 6778 6829 +51
+ Partials 1120 1119 -1
*This pull request uses carry forward flags. Click here to find out more.
|
/run-integration-test |
2 similar comments
/run-integration-test |
/run-integration-test |
Signed-off-by: zeminzhou <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
What problem does this PR solve?
Issue Number: close #343
Problem Description: TBD
What is changed and how does it work?
clean metrics againt
Code changes
Check List for Tests
This PR has been tested by at least one of the following methods:
Side effects
Related changes
To reviewers
Please follow these principles to check this pull requests:
(The above text mainly refers to TiDB Development Guide. It's also highly recommended to read about Writing code review comments)