Skip to content

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Jul 2, 2025

What problem does this PR solve?

Issue Number: ref #61702

Problem Summary:

What changed and how does it work?

Run import into subtasks at system keyspace tidb.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    -- ks1 tidb
    mysql> create table t (a int);
    Query OK, 0 rows affected (0.15 sec)
    
    mysql> import into t from "s3://test/*?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http://127.0.0.1:9000&force
    -path-style=true" with SKIP_ROWS=1;
    +--------+---------------------------------------------------------------------------------------------------------------------+--------------+----------+-------+----------+------------------+---------------+----------------+----------------------------+----------------------------  +----------------------------+------------+
    | Job_ID | Data_Source                                                                                                         | Target_Table | Table_ID | Phase | Status   | Source_File_Size | Imported_Rows | Result_Message | Create_Time                |   Start_Time                 | End_Time                   | Created_By |
    +--------+---------------------------------------------------------------------------------------------------------------------+--------------+----------+-------+----------+------------------+---------------+----------------+----------------------------+----------------------------  +----------------------------+------------+
    |      1 | s3://test/*?access-key=xxxxxx&endpoint=http%3A%2F%2F127.0.0.1%3A9000&force-path-style=true&secret-access-key=xxxxxx | `test`.`t`   |      114 |       | finished | 8B               |             1 |                | 2025-07-03 14:44:21.479238 | 2025-07-03 14:44:22.  264945 | 2025-07-03 14:44:25.784353 | root@%     |
    +--------+---------------------------------------------------------------------------------------------------------------------+--------------+----------+-------+----------+------------------+---------------+----------------+----------------------------+----------------------------  +----------------------------+------------+
    1 row in set (4.67 sec)
    mysql> select * from t;
    '+------+
    | a    |
    +------+
    |    1 |
    +------+
    1 row in set (0.00 sec)
    -- system tidb
    mysql> select id, task_key, type, state, keyspace from mysql.tidb_global_task_history;
    +----+------------------+------------+---------+----------+
    | id | task_key         | type       | state   | keyspace |
    +----+------------------+------------+---------+----------+
    |  1 | ks1/ImportInto/1 | ImportInto | succeed | ks1      |
    +----+------------------+------------+---------+----------+
    1 row in set (0.00 sec)
  • No need to test
    • I checked and no code files have been changed.

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 do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 2, 2025
Copy link

tiprow bot commented Jul 2, 2025

Hi @tangenta. 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-sigs/prow repository.

Copy link

codecov bot commented Jul 2, 2025

Codecov Report

Attention: Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.

Project coverage is 73.7949%. Comparing base (64b3755) to head (955d262).
Report is 9 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #62138        +/-   ##
================================================
+ Coverage   72.8759%   73.7949%   +0.9190%     
================================================
  Files          1740       1770        +30     
  Lines        483032     492520      +9488     
================================================
+ Hits         352014     363455     +11441     
+ Misses       109427     106883      -2544     
- Partials      21591      22182       +591     
Flag Coverage Δ
integration 45.2851% <0.0000%> (?)
unit 72.4295% <54.2857%> (+0.3147%) ⬆️

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

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 46.3528% <ø> (+0.0409%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 2, 2025
@D3Hunter D3Hunter changed the title disttask: run import into subtasks at system keyspace tidb importinto: encode using task keyspace in nextgen Jul 3, 2025
Signed-off-by: tangenta <[email protected]>
Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

@D3Hunter D3Hunter changed the title importinto: encode using task keyspace in nextgen importinto: encode and ingest step use task keyspace in nextgen Jul 3, 2025
Signed-off-by: tangenta <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 3, 2025
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 3, 2025
Copy link

ti-chi-bot bot commented Jul 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, GMHDBJD

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 3, 2025
Copy link

ti-chi-bot bot commented Jul 3, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-07-03 07:59:31.230714984 +0000 UTC m=+1554623.953893963: ☑️ agreed by D3Hunter.
  • 2025-07-03 10:56:57.205897895 +0000 UTC m=+1565269.929076876: ☑️ agreed by GMHDBJD.

@D3Hunter
Copy link
Contributor

D3Hunter commented Jul 3, 2025

/retest

Copy link

tiprow bot commented Jul 3, 2025

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

In response to this:

/retest

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.

@tangenta
Copy link
Contributor Author

tangenta commented Jul 3, 2025

/retest

Copy link

tiprow bot commented Jul 3, 2025

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

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot merged commit b8a0d7f into pingcap:master Jul 3, 2025
22 of 24 checks passed
morgo added a commit to morgo/tidb that referenced this pull request Jul 7, 2025
* origin/master: (79 commits)
  backend/local: add rate limiter for split region and ingest data (pingcap#61555)
  fix(runaway): resolve the dead channel in UpdateNewAndDoneWatch (pingcap#61795)
  *: collect subtask summary for `IMPORT INTO` tasks (pingcap#61600)
  tests: update vector cluster test result (pingcap#62174)
  planner: change casetest instance-plan-cache test timeout. (pingcap#62195)
  planner: remove data race for instance plan cache (pingcap#62217)
  *: upgrade pd client to fix keyspace issue (pingcap#62189)
  resource_control: support collecting cross AZ traffic in ru consumption (pingcap#62003)
  test: wait for statistics owner to close on exit (pingcap#62198)
  planner: remove the selection above the table dual (pingcap#62193)
  telemetry: add telemetry related code back (pingcap#61753)
  planner: move physical limit related logic into physical op. (pingcap#62187)
  planner: remove useless code (pingcap#61968)
  retry: enhance retry for ingestor on nextgen (pingcap#62191)
  importinto: encode and ingest step use task keyspace in nextgen (pingcap#62138)
  planner: lift the can-push-to-cop check of aggregation/proj (pingcap#62068)
  ddl: cannot panic with failpoint panic in the DDLNotifier (pingcap#62151)
  planner: skip empty expression in the applyPredicateSimplification (pingcap#62178)
  codec: should also return the value even with error because the error may be ignored in the future (pingcap#62175)
  parser: also reduce literal list with charset (pingcap#61484)
  ...
morgo added a commit to morgo/tidb that referenced this pull request Jul 7, 2025
* origin/master: (79 commits)
  backend/local: add rate limiter for split region and ingest data (pingcap#61555)
  fix(runaway): resolve the dead channel in UpdateNewAndDoneWatch (pingcap#61795)
  *: collect subtask summary for `IMPORT INTO` tasks (pingcap#61600)
  tests: update vector cluster test result (pingcap#62174)
  planner: change casetest instance-plan-cache test timeout. (pingcap#62195)
  planner: remove data race for instance plan cache (pingcap#62217)
  *: upgrade pd client to fix keyspace issue (pingcap#62189)
  resource_control: support collecting cross AZ traffic in ru consumption (pingcap#62003)
  test: wait for statistics owner to close on exit (pingcap#62198)
  planner: remove the selection above the table dual (pingcap#62193)
  telemetry: add telemetry related code back (pingcap#61753)
  planner: move physical limit related logic into physical op. (pingcap#62187)
  planner: remove useless code (pingcap#61968)
  retry: enhance retry for ingestor on nextgen (pingcap#62191)
  importinto: encode and ingest step use task keyspace in nextgen (pingcap#62138)
  planner: lift the can-push-to-cop check of aggregation/proj (pingcap#62068)
  ddl: cannot panic with failpoint panic in the DDLNotifier (pingcap#62151)
  planner: skip empty expression in the applyPredicateSimplification (pingcap#62178)
  codec: should also return the value even with error because the error may be ignored in the future (pingcap#62175)
  parser: also reduce literal list with charset (pingcap#61484)
  ...
morgo added a commit to morgo/tidb that referenced this pull request Jul 7, 2025
* origin/master: (79 commits)
  backend/local: add rate limiter for split region and ingest data (pingcap#61555)
  fix(runaway): resolve the dead channel in UpdateNewAndDoneWatch (pingcap#61795)
  *: collect subtask summary for `IMPORT INTO` tasks (pingcap#61600)
  tests: update vector cluster test result (pingcap#62174)
  planner: change casetest instance-plan-cache test timeout. (pingcap#62195)
  planner: remove data race for instance plan cache (pingcap#62217)
  *: upgrade pd client to fix keyspace issue (pingcap#62189)
  resource_control: support collecting cross AZ traffic in ru consumption (pingcap#62003)
  test: wait for statistics owner to close on exit (pingcap#62198)
  planner: remove the selection above the table dual (pingcap#62193)
  telemetry: add telemetry related code back (pingcap#61753)
  planner: move physical limit related logic into physical op. (pingcap#62187)
  planner: remove useless code (pingcap#61968)
  retry: enhance retry for ingestor on nextgen (pingcap#62191)
  importinto: encode and ingest step use task keyspace in nextgen (pingcap#62138)
  planner: lift the can-push-to-cop check of aggregation/proj (pingcap#62068)
  ddl: cannot panic with failpoint panic in the DDLNotifier (pingcap#62151)
  planner: skip empty expression in the applyPredicateSimplification (pingcap#62178)
  codec: should also return the value even with error because the error may be ignored in the future (pingcap#62175)
  parser: also reduce literal list with charset (pingcap#61484)
  ...
@D3Hunter D3Hunter mentioned this pull request Aug 12, 2025
65 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants