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

disttask: record endtime for task and subtask #49872

Merged
merged 13 commits into from
Jan 4, 2024

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Dec 28, 2023

What problem does this PR solve?

Issue Number: close #49617

Problem Summary:

What changed and how does it work?

  1. when task is done, record end time for it.
  2. move task state related table op into one file.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 28, 2023
Copy link

tiprow bot commented Dec 28, 2023

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

Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Merging #49872 (02e0f05) into master (89fc440) will decrease coverage by 3.5525%.
Report is 21 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49872        +/-   ##
================================================
- Coverage   72.0615%   68.5090%   -3.5525%     
================================================
  Files          1438       1441         +3     
  Lines        345756     412588     +66832     
================================================
+ Hits         249157     282660     +33503     
- Misses        76461     110899     +34438     
+ Partials      20138      19029      -1109     
Flag Coverage Δ
integration 44.2063% <0.0000%> (?)
unit 71.9328% <ø> (-0.1287%) ⬇️

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

Components Coverage Δ
dumpling 56.3129% <ø> (ø)
parser ∅ <ø> (∅)
br 42.3554% <ø> (-9.3413%) ⬇️

Copy link
Member

@okJiang okJiang 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

pkg/disttask/framework/storage/table_test.go Show resolved Hide resolved
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

@@ -413,7 +413,8 @@ func (stm *TaskManager) FailTask(ctx context.Context, taskID int64, currentState
`update mysql.tidb_global_task
set state=%?,
error = %?,
state_update_time = CURRENT_TIMESTAMP()
state_update_time = CURRENT_TIMESTAMP(),
end_time = CURRENT_TIMESTAMP()
Copy link
Contributor

Choose a reason for hiding this comment

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

some terminate state of task is updated using UpdateTaskAndAddSubTasks, see where .OnDone( is called

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 29, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Dec 29, 2023

/retest

Copy link

tiprow bot commented Dec 29, 2023

@ywqzzy: 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/test-infra repository.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 2, 2024
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Jan 2, 2024

/retest

Copy link

tiprow bot commented Jan 2, 2024

@ywqzzy: 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/test-infra repository.

@ywqzzy ywqzzy requested a review from okJiang January 3, 2024 03:32
Comment on lines 45 to 46
// PausingTask updated task state to pausing.
PauseTask(ctx context.Context, taskKey string) (bool, error)
Copy link
Member

Choose a reason for hiding this comment

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

pause or pausing 🤔

pkg/disttask/framework/storage/task_state.go Outdated Show resolved Hide resolved
Copy link

ti-chi-bot bot commented Jan 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jan 4, 2024
Copy link

ti-chi-bot bot commented Jan 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-02 08:30:07.132774939 +0000 UTC m=+2159298.170001867: ☑️ agreed by D3Hunter.
  • 2024-01-04 02:25:32.280598548 +0000 UTC m=+2310223.317825460: ☑️ agreed by okJiang.

@ti-chi-bot ti-chi-bot bot merged commit 354c186 into pingcap:master Jan 4, 2024
18 checks passed
AilinKid pushed a commit to AilinKid/tidb that referenced this pull request Jan 17, 2024
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

record subtask end time
3 participants