Skip to content

planner: add task based warning handling and collection #61077

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

Merged
merged 4 commits into from
May 14, 2025

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented May 12, 2025

What problem does this PR solve?

Issue Number: ref #60106

Problem Summary:

What changed and how does it work?

whiteboard_exported_image (1)

background:

  • For a different physical operator enumerated from a single logical op, it may gen different warnings. (like: hint is hash-join, we this physic is indexJoin, the corresponding warns associated with this index join should be hint is not applicable for hash-join if the final winner is indexJoin even after preference is considered)
  • From the above case, we could see that warn should be linked with every specific physical operator, but actually it is not. Or more specifically, it should be associated with every specific encapsulated Task. because the task is a unit that decides which physical operator is picked in the current logic level, and corresponding warnings are generated from that decision.
  • Task is structure independent from physical plan pointer, each level's new task cache will have a new task structure(from copy or convert2Root) to store the new parent pointer, so the warnings slice should be integrated in the Task structure as well, which will be clearer and elegant. (ps: why not just append warnings into sctx directly? because those warnings you appended may not be the right warnings generated from the final winner's physics tree downward)
  • Each logic level may generate new warnings, and since we may attach2Task to connect the current picked physics and child task, the new generated task instance here should inherit the warnings from the child task. Note: To use another warning slice, the warning element inside the child task can actually be reused and reorganized.
  • The indexJoinInfo is generated from the underlying data source to store the picked index-related info and keyOffIndex stuff. If the current physics is still on the inner side of an index join, this info should be inherited upward to be used by the upper index join itself.

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

.
Signed-off-by: AilinKid <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 12, 2025
Copy link

tiprow bot commented May 12, 2025

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

AilinKid added 2 commits May 12, 2025 16:16
.
Signed-off-by: AilinKid <[email protected]>
.
Signed-off-by: AilinKid <[email protected]>
Copy link

codecov bot commented May 12, 2025

Codecov Report

Attention: Patch coverage is 51.47059% with 33 lines in your changes missing coverage. Please review.

Project coverage is 73.4214%. Comparing base (f7149b7) to head (f495bbc).
Report is 90 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #61077        +/-   ##
================================================
+ Coverage   73.1364%   73.4214%   +0.2850%     
================================================
  Files          1724       1724                
  Lines        477081     480418      +3337     
================================================
+ Hits         348920     352730      +3810     
+ Misses       106743     106213       -530     
- Partials      21418      21475        +57     
Flag Coverage Δ
integration 42.7397% <51.4705%> (?)
unit 72.3586% <51.4705%> (+0.0012%) ⬆️

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

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 46.9001% <ø> (-0.6495%) ⬇️
🚀 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 approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 12, 2025
Copy link

ti-chi-bot bot commented May 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, qw4990

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 May 14, 2025
Copy link

ti-chi-bot bot commented May 14, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-12 13:21:56.025401816 +0000 UTC m=+364982.173363019: ☑️ agreed by hawkingrei.
  • 2025-05-14 05:04:39.022832094 +0000 UTC m=+507945.170793312: ☑️ agreed by qw4990.

@hawkingrei
Copy link
Member

/retest

@ti-chi-bot ti-chi-bot bot merged commit 2b87000 into pingcap:master May 14, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved index-join-refactor-epic lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants