-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
disttask, ddl: move backend ctx register code to scheduler #46952
Conversation
Hi @tangenta. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #46952 +/- ##
================================================
- Coverage 73.2988% 72.6684% -0.6305%
================================================
Files 1331 1353 +22
Lines 397485 404404 +6919
================================================
+ Hits 291352 293874 +2522
- Misses 87533 91875 +4342
- Partials 18600 18655 +55
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Rest LGTM
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.
rest lgtm
ddl/stage_scheduler.go
Outdated
d: d, | ||
} | ||
s.BaseScheduler.Extension = s | ||
|
||
wrapErr := func(err error) scheduler.Scheduler { | ||
s.BaseScheduler.Extension = &failedExtension{err: err} |
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.
maybe add a Init
which returns error to scheduler and move below part into it?
it's hacky to do it using this way.
if s.backendCtx != nil { | ||
ingest.LitBackCtxMgr.Unregister(s.jobID) | ||
} |
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.
call Close
of base scheduler
util/generic/sync_map.go
Outdated
@@ -44,6 +44,15 @@ func (m *SyncMap[K, V]) Load(key K) (V, bool) { | |||
return val, exist | |||
} | |||
|
|||
// LoadAndDelete loads and deletes a key value atomically. | |||
func (m *SyncMap[K, V]) LoadAndDelete(key K) (V, bool) { |
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.
extend Delete
to return previous value and existed?
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GMHDBJD, ywqzzy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
/unhold |
/ok-to-test |
/retest |
What problem does this PR solve?
Issue Number: ref #46258
Problem Summary:
Previously,
backendCtx
is registered & unregistered every time the subtasks enter the next step. This is quite unefficient because construction & destruction take times.The previous implementation also has the following drawbacks:
What is changed and how it works?
Scheduler
.Close()
method toScheduler
, and unregisterbackendCtx
in it.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.