Skip to content
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

*: add a config to enable write statements to read on TiFlash #37516

Merged
merged 12 commits into from
Sep 2, 2022

Conversation

gengliqi
Copy link
Contributor

@gengliqi gengliqi commented Aug 31, 2022

Signed-off-by: gengliqi gengliqiii@gmail.com

What problem does this PR solve?

Issue Number: close #37515

Problem Summary:

What is changed and how it works?

Add a session config tidb_enable_tiflash_read_for_write_stmt.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 31, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • LittleFall
  • XuHuaiyu

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.

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

@gengliqi gengliqi requested a review from a team as a code owner August 31, 2022 09:51
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 31, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 31, 2022
@gengliqi
Copy link
Contributor Author

/cc @windtalker @LittleFall

Comment on lines 238 to 239
// TiFlashReadForWriteStmt indicates whether to enable write stmts to read on TiFlash.
TiFlashReadForWriteStmt = "tiflash_read_for_write_stmt"
Copy link
Contributor

Choose a reason for hiding this comment

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

There are two conventions with sysvars:

  • Most variable names start with tidb_XX.
  • Boolean options usually use the name tidb_enable_XX

Is it possible to name it something like tidb_enable_tiflash_for_dml?

(unfortunately there are exceptions to both of these conventions, but they are mostly followed.)

Copy link
Contributor Author

@gengliqi gengliqi Sep 1, 2022

Choose a reason for hiding this comment

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

select is considered to be part of DML(strictly speaking, it's DQL). What I want to express is that the read part in insert/update/delete SQL can be pushed down to TiFlash.
How about tidb_enable_tiflash_for_all_dml or tidb_enable_tiflash_read_for_write_stmt?

Copy link
Contributor

@LittleFall LittleFall left a comment

Choose a reason for hiding this comment

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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2022
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot ti-chi-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 2, 2022
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 2, 2022
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@gengliqi
Copy link
Contributor Author

gengliqi commented Sep 2, 2022

/merge

@gengliqi
Copy link
Contributor Author

gengliqi commented Sep 2, 2022

/run-mysql-test

@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Sep 2, 2022

/merge

@gengliqi
Copy link
Contributor Author

gengliqi commented Sep 2, 2022

/run-mysql-test tidb-test=pr/1957

@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 Sep 2, 2022
@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Sep 2, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 92bd9e6

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 2, 2022
@gengliqi
Copy link
Contributor Author

gengliqi commented Sep 2, 2022

/run-mysql-test tidb-test=pr/1957

@gengliqi
Copy link
Contributor Author

gengliqi commented Sep 2, 2022

/run-mysql-test tidb-test=pr/1957

@ti-chi-bot ti-chi-bot merged commit 3e39d45 into pingcap:master Sep 2, 2022
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/L Denotes a PR that changes 100-499 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.

add a config to enable write statements to read on TiFlash
5 participants