Skip to content

Conversation

@wddevries
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #64351

Problem Summary:

When global.tidb_enable_metadata_lock is set to off, the StatementContext.MDLRelatedTableIDs field is not populated. This field is used to populate the tbls and dbNames fields in PlanCacheStmt object, and as a result, the StatementContext.TblInfo2UnionScan field is not populated, which may result in the plan cache returning the incorrect plan.

What changed and how does it work?

MDLRelatedTableIDs is only used to setup PlanCacheStmt, so this patch:

  • renames MDLRelatedTableIDs to RelatedTableIDs,
  • changes tryLockMDLAndUpdateSchemaIfNecessary to always add the table id to RelatedTableIDs,
  • and adds a test for the issue.

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 release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Dec 1, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 1, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign terry1purcell for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/planner SIG: Planner labels Dec 1, 2025
@tiprow
Copy link

tiprow bot commented Dec 1, 2025

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

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.3371%. Comparing base (eeee02d) to head (a91019f).
⚠️ Report is 32 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@ ## master #64795 +/- ## ================================================ - Coverage 74.7061% 73.3371% -1.3691%  ================================================ Files 1888 1868 -20 Lines 515172 511006 -4166 ================================================ - Hits 384865 374757 -10108  - Misses 106492 113965 +7473  + Partials 23815 22284 -1531 
Flag Coverage Δ
integration 41.7464% <100.0000%> (-6.4102%) ⬇️
unit 72.5428% <100.0000%> (+0.2732%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (+0.1132%) ⬆️
parser ∅ <ø> (∅)
br 45.3826% <ø> (-17.8012%) ⬇️
🚀 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.
@wddevries
Copy link
Contributor Author

/retest

@tiprow
Copy link

tiprow bot commented Dec 3, 2025

@wddevries: 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-sigs/prow repository.

@wddevries
Copy link
Contributor Author

/retest

@tiprow
Copy link

tiprow bot commented Dec 3, 2025

@wddevries: 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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

1 participant