-
Notifications
You must be signed in to change notification settings - Fork 289
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
jobmaster(engine/dm): fix empty worker status for OnWorkerOnline/OnWorkerOffline #7689
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-engine-integration-test |
/run-engine-integration-test |
/run-engine-integration-test |
@@ -189,9 +189,14 @@ func (jm *JobMaster) OnWorkerOnline(worker framework.WorkerHandle) error { | |||
|
|||
// handleOnlineStatus is used by OnWorkerOnline and OnWorkerStatusUpdated. | |||
func (jm *JobMaster) handleOnlineStatus(worker framework.WorkerHandle) error { | |||
extBytes := worker.Status().ExtBytes | |||
if len(extBytes) == 0 { |
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 we can remove the usage of OnWorkerOnline
callback, only use OnWorkerStatusUpdated
? That is to say, because DM needs bussiness online message with worker bound information, plain framework online is no use
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.
What if OnWorkerStatusUpdated
is not called because the message is discarded for some reasons, like buffer full
?
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.
worker will be regard as offline after 2*HeartbeatInterval.
tiflow/engine/jobmaster/dm/worker_manager.go
Line 159 in 822a79f
} else if worker.CreateFailed() { |
@@ -201,24 +206,28 @@ func (jm *JobMaster) handleOnlineStatus(worker framework.WorkerHandle) error { | |||
|
|||
// OnWorkerOffline implements JobMasterImpl.OnWorkerOffline | |||
func (jm *JobMaster) OnWorkerOffline(worker framework.WorkerHandle, reason error) error { | |||
extBytes := worker.Status().ExtBytes | |||
if len(extBytes) == 0 { | |||
jm.Logger().Warn("worker status extBytes is empty", zap.String(logutil.ConstFieldWorkerKey, worker.ID())) |
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.
it should not happen, otherwise we have no chance to UpdateClient. Maybe we can use DPanic level and let the logger turn on Development
for DPanic
Line 118 in 822a79f
Development: inDev, |
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.
Let me check whether OnWorkerOffline
can happen without receiving OnWorkerOnline
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.
I left a function comment as
// Only after OnWorkerOnline, OnWorkerOffline of the same worker may be called.
Please help modify it if's no longer correct
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.
It may happen when we receive OnWorkerOnline, OnWorkerOffline but not receiving OnWorkerStatusUpdate
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.
Have confirmed, the comment needs to be updated.
- ✅
OnWorkerOnline
->OnWorkerOffline
- ✅
OnWorkerOffline
, withoutOnWorkerOnline
- ❌
OnWorkerOffline
->OnWorkerOnline
, can't happen - ❌
OnWorkerOnline
, withoutOnWorkerOffline
, can't happen.
err := json.Unmarshal(workerHandle.Status().ExtBytes, &taskStatus) | ||
extBytes := workerHandle.Status().ExtBytes | ||
if len(extBytes) == 0 { | ||
return nil, nil, errors.Errorf("extBytes of %d is empty", workerHandle.ID()) |
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.
we can continue
to waiting worker's UpdateStatus?
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.
restart and recover until worker's UpdateStatusEvent
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 9700119
|
@GMHDBJD: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #7689 +/- ##
================================================
+ Coverage 59.9132% 59.9277% +0.0145%
================================================
Files 810 809 -1
Lines 93098 93052 -46
================================================
- Hits 55778 55764 -14
+ Misses 32472 32427 -45
- Partials 4848 4861 +13 |
What problem does this PR solve?
Issue Number: close #7691
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note