Skip to content

Conversation

@hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Dec 18, 2025

What problem does this PR solve?

Issue Number: close #65059

Problem Summary:

What changed and how does it work?

Because we use RC isolation, so isForUpdateRead is true.

b.hintProcessor = processor
b.isForUpdateRead = sctx.GetSessionVars().IsPessimisticReadConsistency()
b.noDecorrelate = sctx.GetSessionVars().EnableNoDecorrelateInSelect

Here will not remove the tikv path.

// remain tikv access path to generate point get acceess path if existed
// see detail in issue: https://github.com/pingcap/tidb/issues/39543
if !(b.isForUpdateRead && b.ctx.GetSessionVars().TxnCtx.IsExplicit) {
// Skip storage engine check for CreateView.
if b.capFlag&canExpandAST == 0 {
possiblePaths, err = util.FilterPathByIsolationRead(b.ctx, possiblePaths, tblName, dbName)
if err != nil {
return nil, err
}
}
}

findBestTask4LogicalDataSource will remove the tiflash path when isForUpdateRead is true

if ds.IsForUpdateRead && ds.SCtx().GetSessionVars().TxnCtx.IsExplicit {
hasPointGetPath := false
for _, path := range ds.PossibleAccessPaths {
if isPointGetPath(ds, path) {
hasPointGetPath = true
break
}
}
tblName := ds.TableInfo.Name
ds.PossibleAccessPaths, err = util.FilterPathByIsolationRead(ds.SCtx(), ds.PossibleAccessPaths, tblName, ds.DBName)
if err != nil {
return nil, err
}
if hasPointGetPath {
newPaths := make([]*util.AccessPath, 0)
for _, path := range ds.PossibleAccessPaths {
// if the path is the point get range path with for update lock, we should forbid tiflash as it's store path (#39543)
if path.StoreType != kv.TiFlash {
newPaths = append(newPaths, path)
}
}
ds.PossibleAccessPaths = newPaths
}
}

If this expression is not of the type "select for update" and there are no tikv replicas, even if it is set to RC, it will not cut off tiflash. However, if it is of the type "select for update," then tiflash will be cut off and it will be forced to use tikv.

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/planner SIG: Planner do-not-merge/needs-triage-completed and removed do-not-merge/needs-tests-checked labels Dec 18, 2025
@hawkingrei hawkingrei force-pushed the fix_enforce_mpp branch 3 times, most recently from 82378ce to 492f8d7 Compare December 18, 2025 14:38
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-triage-completed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.5957%. Comparing base (8227b49) to head (31c7b06).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #65127        +/-   ##
================================================
- Coverage   70.7556%   68.5957%   -2.1599%     
================================================
  Files          1895       1873        -22     
  Lines        517902     510371      -7531     
================================================
- Hits         366445     350093     -16352     
- Misses       126934     137898     +10964     
+ Partials      24523      22380      -2143     
Flag Coverage Δ
integration 41.5517% <44.4444%> (-6.6188%) ⬇️

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 38.4708% <ø> (-19.7658%) ⬇️
🚀 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.

…tion

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 19, 2025
@hawkingrei
Copy link
Member Author

/retest

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

/retest

1 similar comment
@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: you06
Once this PR has been reviewed and has the lgtm label, please assign ailinkid 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.

Details 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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 19, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 19, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-19 10:31:38.262126942 +0000 UTC m=+1814643.075904504: ☑️ agreed by you06.

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@tiprow
Copy link

tiprow bot commented Dec 19, 2025

@hawkingrei: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 31c7b06 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 19, 2025

@hawkingrei: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-unit-test-next-gen 31c7b06 link true /test pull-unit-test-next-gen
idc-jenkins-ci-tidb/unit-test 31c7b06 link true /test unit-test

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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

Labels

needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. 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.

TiFlash plan returns No access path error in RC isolation level

2 participants