Skip to content

importinto: fix zero update time during validation phase and refine logs#63425

Merged
ti-chi-bot[bot] merged 2 commits into
pingcap:masterfrom
D3Hunter:fix-zero-update-time
Sep 9, 2025
Merged

importinto: fix zero update time during validation phase and refine logs#63425
ti-chi-bot[bot] merged 2 commits into
pingcap:masterfrom
D3Hunter:fix-zero-update-time

Conversation

@D3Hunter

@D3Hunter D3Hunter commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: ref #61702

Problem Summary:

What changed and how does it work?

we add update time in #62283, the value is from update time of subtask summary, but during validation phase, we don't have subtask level summary. this pr change to use the update time of the job itself in this case

refine logs to print related task/subtask id and other info

Check List

Tests

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

before, at validating step, Last_Update_Time is zero

+--------+-----------+-------------+--------------+----------+------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
| Job_ID | Group_Key | Data_Source | Target_Table | Table_ID | Phase      | Status  | Source_File_Size | Imported_Rows | Result_Message | Create_Time                | Start_Time                 | End_Time | Created_By | Last_Update_Time    | Cur_Step     | Cur_Step_Processed_Size | Cur_Step_Total_Size | Cur_Step_Progress_Pct | Cur_Step_Speed | Cur_Step_ETA |
+--------+-----------+-------------+--------------+----------+------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
|     24 | NULL      | s3://...... | `test`.`t1`  |       62 | validating | running | 906.2GiB         |    1813500000 |                | 2025-09-09 03:23:54.821017 | 2025-09-09 03:23:56.997573 | NULL     | root@%     | 0000-00-00 00:00:00 | post-process | 0B                      | 0B                  | N/A                   | 0B/s           | N/A          |

after this PR, we can see the Last_Update_Time is shown correctly

+--------+-----------+-------------+--------------+----------+------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+----------------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
| Job_ID | Group_Key | Data_Source | Target_Table | Table_ID | Phase      | Status  | Source_File_Size | Imported_Rows | Result_Message | Create_Time                | Start_Time                 | End_Time | Created_By | Last_Update_Time           | Cur_Step     | Cur_Step_Processed_Size | Cur_Step_Total_Size | Cur_Step_Progress_Pct | Cur_Step_Speed | Cur_Step_ETA |
+--------+-----------+-------------+--------------+----------+------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+----------------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
|      1 | NULL      | s3://...... | `test`.`ks1` |        7 | validating | running | 12B              |             6 |                | 2025-09-09 15:34:17.942410 | 2025-09-09 15:34:18.489710 | NULL     | root@%     | 2025-09-09 15:34:21.488645 | post-process | 0B                      | 0B                  | N/A                   | 0B/s           | N/A          |
+--------+-----------+-------------+--------------+----------+------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+----------------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+

process chunk can print the task/subtask id

[2025/09/09 15:34:19.248 +08:00] [INFO] [chunk_process.go:377] ["process chunk start"] [keyspaceName=SYSTEM] [task-id=1] [task-key=SYSTEM/ImportInto/1] [step=import] [subtask-id=1] [key=a.csv:0]

print table id during scheduler, and print task info during other split subtasks of encode step

[2025/09/09 16:27:42.541 +08:00] [INFO] [scheduler.go:302] ["on next subtasks batch"] [keyspaceName=SYSTEM] [task-id=90001] [task-key=keyspace1/ImportInto/1] [curr-step=init] [next-step=import] [node-count=1] [table-id=7]
[2025/09/09 16:27:42.574 +08:00] [INFO] [s3.go:493] ["succeed to get bucket region from s3"] [keyspaceName=SYSTEM] ["bucket region"=us-east-1]
[2025/09/09 16:27:42.581 +08:00] [INFO] [import.go:1335] ["auto calculate resource related params"] [keyspaceName=SYSTEM] [task-id=90001] [task-key=keyspace1/ImportInto/1] [curr-step=init] [next-step=import] [node-count=1] [table-id=7] ["thread count"=1] ["max node count"=1] ["dist sql scan concurrency"=15] ["target node cpu count"=10] ["total file size"=12B]
[2025/09/09 16:27:42.581 +08:00] [INFO] [table_import.go:404] ["populate chunks start"] [keyspaceName=SYSTEM] [task-id=90001] [task-key=keyspace1/ImportInto/1] [curr-step=init] [next-step=import] [node-count=1] [table-id=7]
[2025/09/09 16:27:42.581 +08:00] [INFO] [table_import.go:415] ["adjust max engine size"] [keyspaceName=SYSTEM] [task-id=90001] [task-key=keyspace1/ImportInto/1] [curr-step=init] [next-step=import] [node-count=1] [table-id=7] [before=107374182400] [after=12]
[2025/09/09 16:27:42.581 +08:00] [INFO] [region.go:293] [makeTableRegions] [keyspaceName=SYSTEM] [task-id=90001] [task-key=keyspace1/ImportInto/1] [curr-step=init] [next-step=import] [node-count=1] [table-id=7] [filesCount=1] [MaxChunkSize=268435456] [RegionsCount=1] [BatchSize=12] [cost=21µs]
[2025/09/09 16:27:42.581 +08:00] [INFO] [table_import.go:406] ["populate chunks completed"] [keyspaceName=SYSTEM] [task-id=90001] [task-key=keyspace1/ImportInto/1] [curr-step=init] [next-step=import] [node-count=1] [table-id=7] [takeTime=420.291µs] []

  • 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 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. labels Sep 9, 2025
@tiprow

tiprow Bot commented Sep 9, 2025

Copy link
Copy Markdown

Hi @D3Hunter. 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.

Details

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.

@D3Hunter

D3Hunter commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-nextgen-20250815

@ti-chi-bot

Copy link
Copy Markdown
Member

@D3Hunter: once the present PR merges, I will cherry-pick it on top of release-nextgen-20250815 in the new PR and assign it to you.

Details

In response to this:

/cherry-pick release-nextgen-20250815

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.

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 9, 2025
@D3Hunter

D3Hunter commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Sep 9, 2025

Copy link
Copy Markdown

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

Details

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.

@codecov

codecov Bot commented Sep 9, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.1966%. Comparing base (68d18d6) to head (0620b88).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #63425        +/-   ##
================================================
+ Coverage   72.7588%   73.1966%   +0.4377%     
================================================
  Files          1835       1835                
  Lines        496690     496774        +84     
================================================
+ Hits         361386     363622      +2236     
+ Misses       113324     111249      -2075     
+ Partials      21980      21903        -77     
Flag Coverage Δ
integration 42.0163% <3.1250%> (?)
unit 72.3002% <50.0000%> (+0.0129%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 46.5116% <ø> (+0.0381%) ⬆️
🚀 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 commented Sep 9, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

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

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 9, 2025
@ti-chi-bot

ti-chi-bot Bot commented Sep 9, 2025

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2025-09-09 08:36:55.738293203 +0000 UTC m=+350482.298174690: ☑️ agreed by joechenrh.
  • 2025-09-09 09:03:22.481544537 +0000 UTC m=+352069.041426034: ☑️ agreed by GMHDBJD.

@D3Hunter

D3Hunter commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Sep 9, 2025

Copy link
Copy Markdown

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

Details

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.

@lance6716

Copy link
Copy Markdown
Contributor

/retest

@tiprow

tiprow Bot commented Sep 9, 2025

Copy link
Copy Markdown

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

Details

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 37f8a14 into pingcap:master Sep 9, 2025
28 checks passed
@ti-chi-bot

Copy link
Copy Markdown
Member

@D3Hunter: new pull request created to branch release-nextgen-20250815: #63430.
But this PR has conflicts, please resolve them!

Details

In response to this:

/cherry-pick release-nextgen-20250815

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.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Sep 9, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@D3Hunter D3Hunter deleted the fix-zero-update-time branch September 9, 2025 12:46
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.

5 participants