Skip to content

Conversation

elsa0520
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #60297

Problem Summary:

What changed and how does it work?

The "indexjoin + streamagg + indexlookup + nocommonhandle" will trigger a panic in ISSUE.
The root cause is that when building the stream agg and push it into coptask, tidb miss the handlecolumns on the coptask and double read tablescan side.

The reason why the reset cop task needs to be specially modified here is that:

  1. The cop task has been constructed in the previous logic, but it was not possible to determine whether the stream agg was needed (that is, whether keep order was true).
  2. when updating the keep order, the relevant properties in the cop task need to be modified at the same time.

All reset code is copied from the logic when keep order is true in function constructDS2IndexScanTask.

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.

修复 indexjoin + streamagg 可能遇到的 panic 问题。

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 25, 2025
Copy link

tiprow bot commented Apr 25, 2025

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

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.2882%. Comparing base (6ec0bd2) to head (65a34ef).
Report is 77 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #60852        +/-   ##
================================================
+ Coverage   73.1007%   73.2882%   +0.1875%     
================================================
  Files          1714       1721         +7     
  Lines        474901     489650     +14749     
================================================
+ Hits         347156     358856     +11700     
- Misses       106388     109368      +2980     
- Partials      21357      21426        +69     
Flag Coverage Δ
integration 42.6050% <91.3043%> (?)
unit 72.3703% <34.7826%> (+0.0393%) ⬆️

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

Components Coverage Δ
dumpling 52.7118% <ø> (+0.0564%) ⬆️
parser ∅ <ø> (∅)
br 45.3830% <ø> (-1.8928%) ⬇️
🚀 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.

Comment on lines +1958 to +1962
if dsCopTask.tablePlan != nil {
physicalTableScan, _ = dsCopTask.tablePlan.(*PhysicalTableScan)
if physicalTableScan == nil && len(dsCopTask.tablePlan.Children()) == 1 {
physicalTableScan, _ = dsCopTask.tablePlan.Children()[0].(*PhysicalTableScan)
}
Copy link
Member

Choose a reason for hiding this comment

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

Is there any other case? Projection or UnionScan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, there is no logic in the code.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 27, 2025
Copy link

ti-chi-bot bot commented Apr 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qw4990, 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 27, 2025
Copy link

ti-chi-bot bot commented Apr 27, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-27 03:33:49.672647691 +0000 UTC m=+758573.484438070: ☑️ agreed by qw4990.
  • 2025-04-27 06:15:27.716150146 +0000 UTC m=+768271.527940527: ☑️ agreed by winoros.

@elsa0520
Copy link
Contributor Author

/test mysql-test

@elsa0520
Copy link
Contributor Author

/test check-dev2

Copy link

tiprow bot commented Apr 27, 2025

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

In response to this:

/test mysql-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-sigs/prow repository.

Copy link

tiprow bot commented Apr 27, 2025

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

In response to this:

/test check-dev2

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.

@elsa0520
Copy link
Contributor Author

/cheery-pick release-8.5

@elsa0520
Copy link
Contributor Author

/cherry-pick release-8.5

@ti-chi-bot
Copy link
Member

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

In response to this:

/cherry-pick release-8.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 ti-chi-bot bot merged commit f315342 into pingcap:master Apr 27, 2025
23 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #60868.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

index out of range using IndexJoin
4 participants