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

domain: splite handleDDLEvent into new thread #53734

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Jun 2, 2024

What problem does this PR solve?

Issue Number: ref #53744

Problem Summary:

What changed and how does it work?

Now, handleDDlEvent is put into the goroutine which also handles gcstats and other works. so it cannot handle ddl event as soon as possible. it will lead to the problem. for example, If we cannot handle the CreateTable event promptly, this table hasn't the stats.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 2, 2024
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 55.7310%. Comparing base (a44d409) to head (ad40b48).
Report is 1 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53734         +/-   ##
=================================================
- Coverage   72.5980%   55.7310%   -16.8671%     
=================================================
  Files          1506       1626        +120     
  Lines        431531     602137     +170606     
=================================================
+ Hits         313283     335577      +22294     
- Misses        98967     243422     +144455     
- Partials      19281      23138       +3857     
Flag Coverage Δ
integration 37.2632% <81.2500%> (?)
unit 71.4070% <81.2500%> (-0.1815%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 50.5359% <ø> (+8.7276%) ⬆️

@@ -2250,6 +2250,10 @@ func (do *Domain) UpdateTableStatsLoop(ctx, initStatsCtx sessionctx.Context) err
// This is because the updated worker's primary responsibilities are to update the change delta and handle DDL operations.
// These tasks do not interfere with or depend on the initialization process.
do.wg.Run(func() { do.updateStatsWorker(ctx, owner) }, "updateStatsWorker")
do.wg.Run(func() {
<-do.StatsHandle().InitStatsDone
Copy link
Contributor

Choose a reason for hiding this comment

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

select with ctx to avoid dead wait?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have removed the logical that wait for init-stats.

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
*
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei requested a review from lance6716 June 4, 2024 13:47
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 4, 2024
Copy link

ti-chi-bot bot commented Jun 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, winoros

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 5, 2024
Copy link

ti-chi-bot bot commented Jun 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-04 13:48:52.929516884 +0000 UTC m=+3389086.686652453: ☑️ agreed by winoros.
  • 2024-06-05 03:41:06.09676619 +0000 UTC m=+3439019.853901755: ☑️ agreed by lance6716.

@ti-chi-bot ti-chi-bot bot merged commit d5f4841 into pingcap:master Jun 5, 2024
22 of 23 checks passed
@hawkingrei hawkingrei deleted the pkg branch August 7, 2024 11:03
@hawkingrei
Copy link
Member Author

/cherrypick release-8.1
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.5

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-6.5: #55275.

In response to this:

/cherrypick release-8.1
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.5

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 Aug 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.1: #55276.

In response to this:

/cherrypick release-8.1
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.5

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
Copy link
Member

@hawkingrei: new pull request created to branch release-7.5: #55277.

In response to this:

/cherrypick release-8.1
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.5

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 Aug 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-8.1: #55278.

In response to this:

/cherrypick release-8.1
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.5

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.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants