Skip to content

planner: not push tiflash if extra phys tbl id is needed#32830

Merged
ti-chi-bot merged 8 commits intopingcap:masterfrom
windtalker:not_push_tiflash_if_extra_phys_tbl_id_is_needed
Mar 5, 2022
Merged

planner: not push tiflash if extra phys tbl id is needed#32830
ti-chi-bot merged 8 commits intopingcap:masterfrom
windtalker:not_push_tiflash_if_extra_phys_tbl_id_is_needed

Conversation

@windtalker
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #32829

Problem Summary:

What is changed and how it works?

The root cause is TiFlash does not support virtual column ExtraPhysTblID yet.
This pr explicitly remove TiFlash's access path if ExtraPhysTblID is needed.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

None

Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 4, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • mjonss
  • tiancaiamao

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 4, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Mar 4, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@windtalker windtalker changed the title Not push tiflash if extra phys tbl id is needed planner: Not push tiflash if extra phys tbl id is needed Mar 4, 2022
@windtalker windtalker changed the title planner: Not push tiflash if extra phys tbl id is needed planner: not push tiflash if extra phys tbl id is needed Mar 4, 2022
@windtalker
Copy link
Contributor Author

/run-unit-test

Copy link
Contributor

@mjonss mjonss left a comment

Choose a reason for hiding this comment

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

LGTM

Just a question about SelectLock/SELECT FOR UPDATE, maybe we should at least add a comment where the plan is made why it would not use TiFlash? (OK to ignore)

c.Assert(strings.Contains(res, "tiflash"), IsTrue)
c.Assert(strings.Contains(res, "tikv"), IsFalse)

rows = tk.MustQuery("explain select count(*) from t for update").Rows()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know where in the planner this is decided to never go to tiflash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's here.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 4, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 4, 2022
@windtalker
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: d294a8c

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 4, 2022
@hawkingrei
Copy link
Member

/run-unit-test

@windtalker
Copy link
Contributor Author

/run-all-tests

@windtalker
Copy link
Contributor Author

/run-unit-test

@hawkingrei
Copy link
Member

/run-mysql-test

@hawkingrei
Copy link
Member

/run-unit-test

@hawkingrei
Copy link
Member

/run-unit-test

@hawkingrei
Copy link
Member

Please fix the unit test.

[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-484)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-485)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-486)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-487)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-488)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-489)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-490)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-491)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-492)[](https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/39101/pipeline#step-59-log-493)[2022-03-04T15:37:35.014Z] ----------------------------------------------------------------------

[2022-03-04T15:37:35.014Z] FAIL: tiflash_test.go:101: tiflashTestSuite.TestReadPartitionTable

[2022-03-04T15:37:35.014Z] 

[2022-03-04T15:37:35.014Z] tiflash_test.go:123:

[2022-03-04T15:37:35.014Z]     tk.MustQuery("select /*+ STREAM_AGG() */ count(*) from t").Check(testkit.Rows("4"))

[2022-03-04T15:37:35.014Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:354:

[2022-03-04T15:37:35.014Z]     tk.c.Assert(err, check.IsNil, comment)

[2022-03-04T15:37:35.014Z] ... value *errors.withStack = [planner:1815]Internal : No access path for table 't' is found with 'tidb_isolation_read_engines' = 'tiflash', valid values can be 'tikv'. Please check tiflash replica or ensure the query is readonly. ("[planner:1815]Internal : No access path for table 't' is found with 'tidb_isolation_read_engines' = 'tiflash', valid values can be 'tikv'. Please check tiflash replica or ensure the query is readonly.")

[2022-03-04T15:37:35.014Z] ... sql:select /*+ STREAM_AGG() */ count(*) from t, args:[]

[2022-03-04T15:37:35.014Z] 

[2022-03-04T15:37:35.014Z] OOPS: 0 passed, 1 FAILED

@windtalker
Copy link
Contributor Author

/run-mysql-test

@sre-bot
Copy link
Contributor

sre-bot commented Mar 5, 2022

@ti-chi-bot ti-chi-bot merged commit b0f823c into pingcap:master Mar 5, 2022
windtalker added a commit to windtalker/tidb that referenced this pull request Mar 14, 2022
@windtalker windtalker deleted the not_push_tiflash_if_extra_phys_tbl_id_is_needed branch October 23, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TiFlash throw DB::String TiDB::TableInfo::getColumnName(const DB::ColumnID) const: Invalidate column id -3 for table t_137 error

6 participants