Skip to content
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

ddl: support set explicit task type for ddl request #45789

Merged
merged 4 commits into from Aug 9, 2023

Conversation

glorv
Copy link
Contributor

@glorv glorv commented Aug 3, 2023

What problem does this PR solve?

Issue Number: ref #44517

Problem Summary:

What is changed and how it works?

Set the ExplicitRequestSourceType for all ddl kv request and ingest request to support control ddl tasks as background tasks.
This PR depends on tikv/client-go#890, that is, only set the ExplicitRequestSourceType to ddl if RequestSourceType is not ddl. In both ways, tikv can parse the source component as ddl correctly.

NOTE: Background control for DDL distributed framework is not fully supported currently because the framework itself is not mature. We will see what need to do after the the framework supports handling ddl jobs.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 3, 2023
@tiprow
Copy link

tiprow bot commented Aug 3, 2023

Hi @glorv. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

@glorv
Copy link
Contributor Author

glorv commented Aug 3, 2023

@wjhuang2016 PTAL for the ddl and ddl ingest part, and @lance6716 PTAL at the changes for lightning part.

@hawkingrei
Copy link
Member

/test all

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #45789 (5540c1b) into master (a0cbff2) will decrease coverage by 0.6824%.
Report is 6 commits behind head on master.
The diff coverage is 23.0769%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #45789        +/-   ##
================================================
- Coverage   73.3499%   72.6675%   -0.6825%     
================================================
  Files          1277       1298        +21     
  Lines        393392     399566      +6174     
================================================
+ Hits         288553     290355      +1802     
- Misses        86434      90739      +4305     
- Partials      18405      18472        +67     
Flag Coverage Δ
integration 25.5025% <23.0769%> (?)

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0602% <ø> (ø)
br 47.6274% <0.0000%> (-4.4038%) ⬇️

@glorv
Copy link
Contributor Author

glorv commented Aug 4, 2023

/hold waiting for to be merged tikv/client-go#890

@ti-chi-bot ti-chi-bot bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 4, 2023
@@ -1443,7 +1444,7 @@ func (w *updateColumnWorker) cleanRowMap() {
// BackfillData will backfill the table record in a transaction. A lock corresponds to a rowKey if the value of rowKey is changed.
func (w *updateColumnWorker) BackfillData(handleRange reorgBackfillTask) (taskCtx backfillTaskContext, errInTxn error) {
oprStartTime := time.Now()
ctx := kv.WithInternalSourceType(context.Background(), w.jobContext.ddlJobSourceType())
ctx := kv.WithInternalSourceAndTaskType(context.Background(), w.jobContext.ddlJobSourceType(), kvutil.ExplicitTypeDDL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it cannot use WithInternalSourceType? it should also be ddl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ddlJobSourceType() returns something like "ddl_add_index", so in our current check logic, this can't be recognized as ddl.

@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2023
@glorv
Copy link
Contributor Author

glorv commented Aug 9, 2023

/unhold
@wjhuang2016 @nolouch PTAL again, thank you~

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 9, 2023
@glorv
Copy link
Contributor Author

glorv commented Aug 9, 2023

/test build

@tiprow
Copy link

tiprow bot commented Aug 9, 2023

@glorv: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test build

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.

@glorv
Copy link
Contributor Author

glorv commented Aug 9, 2023

/test build

@tiprow
Copy link

tiprow bot commented Aug 9, 2023

@glorv: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test build

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.

@hawkingrei
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test label Aug 9, 2023
@tiprow
Copy link

tiprow bot commented Aug 9, 2023

@glorv: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test 5540c1b link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Copy link
Member

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 9, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-04 02:49:39.909604867 +0000 UTC m=+412863.851953403: ☑️ agreed by lance6716.
  • 2023-08-09 07:56:49.808856999 +0000 UTC m=+99374.357872986: ☑️ agreed by nolouch.

@glorv
Copy link
Contributor Author

glorv commented Aug 9, 2023

/hold waiting for @wjhuang2016's review

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 9, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, nolouch, wjhuang2016

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:
  • OWNERS [lance6716,wjhuang2016]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@glorv
Copy link
Contributor Author

glorv commented Aug 9, 2023

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 9, 2023
@glorv
Copy link
Contributor Author

glorv commented Aug 9, 2023

/test unit-test

@tiprow
Copy link

tiprow bot commented Aug 9, 2023

@glorv: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test unit-test

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.

@hawkingrei
Copy link
Member

/test all

@ti-chi-bot ti-chi-bot bot merged commit 1b7a17e into pingcap:master Aug 9, 2023
20 of 30 checks passed
@glorv glorv deleted the ddl-task-type branch December 15, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants