localbackend: add cloud region job worker | tidb-test=ccf9f5de6817ed2e54c18f2c1757056d2c8b4e4c#60543
Conversation
|
Hi @D3Hunter. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
| // If non-retryable error occurs, it will return the error. | ||
| // If retryable error occurs, it will return nil and caller should check the stage | ||
| // of the regionJob to determine what to do with it. | ||
| func (w *regionJobBaseWorker) doRunJob(ctx context.Context, job *regionJob) error { |
There was a problem hiding this comment.
this is the previous local.executeJob
| // worker need a lot of change before we can do it, will refactor it later. | ||
|
|
||
| // TODO: choose target stage based on error. | ||
| j.convertStageTo(needRescan) |
There was a problem hiding this comment.
will implement this later after the ingestcli.Client is implemented
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/ng-tidb #60543 +/- ##
====================================================
Coverage ? 73.8241%
====================================================
Files ? 1742
Lines ? 481523
Branches ? 0
====================================================
Hits ? 355480
Misses ? 104077
Partials ? 21966
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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-sigs/prow repository. |
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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-sigs/prow repository. |
| doRunJobFn func(ctx context.Context, job *regionJob) error | ||
| writeFn func(ctx context.Context, j *regionJob) (*tikvWriteResult, error) | ||
| ingestFn func(ctx context.Context, j *regionJob) error | ||
| runJobFn func(ctx context.Context, job *regionJob) error |
There was a problem hiding this comment.
My first feeling is write and ingest are sub-steps of runJob, they are not at the same level of concepts. Can you add another precheckFn and delete runJobFn for the special logic of opRegionJobWorker?
There was a problem hiding this comment.
yes, writeFn/ingestFn are part of running one job, they are not part of the worker which runs many jobs, initially I tried to abstract a jobRunner, op/cloud have different implementation, and they share the same worker, but it doesn't make code more clearer, so i quit.
add another precheckFn
good idea, i will try make it a preRunJobFn
| } | ||
| } | ||
|
|
||
| // if the job is empty, it might go to ingested stage directly. |
There was a problem hiding this comment.
this should be put above line 170?
There was a problem hiding this comment.
it's trying to explain why we need to skip calling ingestFn
I hope we can refactor this part to following the state machine, now there are too many place changing fields of job
| return nil | ||
| } | ||
| if res.emptyJob { | ||
| job.convertStageTo(ingested) |
There was a problem hiding this comment.
these j.convertStageTo are written outside of writeFn. But for ingestFn they are written inside ingestFn. It's not tidy.
There was a problem hiding this comment.
yes, it's hard to refactor this part in a single PR, i write a todo in cloudRegionJobWorker.ingest
// TODO, we should let outer logic handle stage transition, currently, OP
// worker need a lot of change before we can do it, will refactor it later.|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lance6716, tangenta The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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-sigs/prow repository. |
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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-sigs/prow repository. |
|
/retest |
|
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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-sigs/prow repository. |
What problem does this PR solve?
Issue Number: ref #60418
Problem Summary:
What changed and how does it work?
Backendto baseJobWorkerCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.