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

variable: unifiy MaxExecuteTime usage and fix some problem #50915

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

jiyfhust
Copy link
Contributor

@jiyfhust jiyfhust commented Feb 1, 2024

What problem does this PR solve?

Please create an issue first to describe the problem.

There MUST be one line starting with "Issue Number: " and
linking the relevant issues via the "close" or "ref".

For more info, check https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/contribute-code.html#referring-to-an-issue.

-->

Issue Number: close #50914, close #50872

Problem Summary:

What changed and how does it work?

  1. provide a Function GetMaxExecutionTime for SessionVars.
  2. Fix two potential bug, caused by not properly used MaxExecutionTime, one about plan_stats,the other expression/build_in.
  3. Fix a bug related with tidb_stats_load_sync_wait
  4. unify code for GetMaxExecutionTime.

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-triage-completed release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 1, 2024
Copy link

tiprow bot commented Feb 1, 2024

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

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Feb 1, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Feb 1, 2024
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Merging #50915 (9a34a94) into master (1f03420) will increase coverage by 2.1090%.
Report is 121 commits behind head on master.
The diff coverage is 77.7777%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #50915        +/-   ##
================================================
+ Coverage   70.5752%   72.6843%   +2.1090%     
================================================
  Files          1467       1467                
  Lines        434756     434772        +16     
================================================
+ Hits         306830     316011      +9181     
+ Misses       108651      98830      -9821     
- Partials      19275      19931       +656     
Flag Coverage Δ
integration 49.2220% <66.6666%> (?)
unit 70.3157% <77.7777%> (-0.0529%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.3819% <ø> (+5.5278%) ⬆️

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Feb 4, 2024

@YangKeao Could you take a look at this? It is more like a code unifiy enhencement.

@hawkingrei
Copy link
Member

/retest

@@ -38,7 +38,7 @@ func (collectPredicateColumnsPoint) optimize(_ context.Context, plan LogicalPlan
return plan, planChanged, nil
}
predicateNeeded := variable.EnableColumnTracking.Load()
syncWait := plan.SCtx().GetSessionVars().StatsLoadSyncWait * time.Millisecond.Nanoseconds()
Copy link
Member

Choose a reason for hiding this comment

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

This change is not about the max execution time, just wrong time unit is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it fix issue #50872.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Feb 6, 2024

/test pull-integration-ddl-test

Copy link

tiprow bot commented Feb 6, 2024

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

  • /test tidb_parser_test
  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test pull-integration-ddl-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.

@qw4990 qw4990 self-requested a review February 8, 2024 02:28
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2024
Copy link

ti-chi-bot bot commented Feb 13, 2024

PR needs rebase.

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.

@jiyfhust
Copy link
Contributor Author

PTAL @winoros @hawkingrei @qw4990

@jiyfhust jiyfhust force-pushed the unified_max_execute_time branch 2 times, most recently from bd5fcb3 to 9a34a94 Compare February 19, 2024 07:45
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 20, 2024
@jiyfhust
Copy link
Contributor Author

brothers, look look.

@jiyfhust
Copy link
Contributor Author

/check-issue-triage-complete

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 28, 2024
@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 4, 2024

@qw4990
PTAL PTAL PTAL

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 4, 2024
Copy link

ti-chi-bot bot commented Mar 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-28 16:09:27.394039452 +0000 UTC m=+1064656.141662556: ☑️ agreed by winoros.
  • 2024-03-04 08:10:14.870912869 +0000 UTC m=+68241.893159259: ☑️ agreed by qw4990.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Mar 4, 2024

please assign yudongusa, zanmato1984 for approval

Can you take a look at this, thanks. @zanmato1984

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

LGTM

@easonn7
Copy link

easonn7 commented Mar 4, 2024

/approve

Copy link

ti-chi-bot bot commented Mar 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, qw4990, windtalker, 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 the approved label Mar 4, 2024
@ti-chi-bot ti-chi-bot bot merged commit 13bff87 into pingcap:master Mar 4, 2024
23 checks passed
@jiyfhust jiyfhust deleted the unified_max_execute_time branch March 4, 2024 12:34
@winoros
Copy link
Member

winoros commented Apr 15, 2024

/run-cherry-picker release-7.1
/run-cherry-picker release-7.5

@winoros
Copy link
Member

winoros commented Apr 15, 2024

/cherrypick release-7.1
/cherrypick release-7.5

@ti-chi-bot
Copy link
Member

@winoros: new pull request created to branch release-7.1: #52618.

In response to this:

/cherrypick release-7.1
/cherrypick release-7.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 Apr 15, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@winoros: new pull request created to branch release-7.5: #52619.

In response to this:

/cherrypick release-7.1
/cherrypick release-7.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 Apr 15, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
winoros added a commit to ti-chi-bot/tidb that referenced this pull request Nov 11, 2024
winoros added a commit to ti-chi-bot/tidb that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. 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
7 participants