-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner, session: add isolation read with engine type #12997
Merged
lzmhhh123
merged 15 commits into
pingcap:master
from
lzmhhh123:dev/add_location_read_variables
Nov 1, 2019
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dc14d9a
add two session variables for isolation read
lzmhhh123 e54cc4f
change import format
lzmhhh123 5d698fb
address comment
lzmhhh123 a8f6ed0
fix fmt
lzmhhh123 cd03698
remove isolation read labels and make engines effective
lzmhhh123 f7a43be
fix ci
lzmhhh123 12fd1a3
fix fmt and add comment
lzmhhh123 823f9d8
address comments
lzmhhh123 4e74333
add test for none access path
lzmhhh123 88143f1
fix fmt
lzmhhh123 77744ab
address comments
lzmhhh123 119babc
address comments
lzmhhh123 fc4a60b
address comment
lzmhhh123 63b15ac
Merge branch 'master' into dev/add_location_read_variables
sre-bot 12d3bb2
Merge branch 'master' into dev/add_location_read_variables
sre-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ import ( | |
"github.com/pingcap/parser/ast" | ||
"github.com/pingcap/parser/mysql" | ||
"github.com/pingcap/tidb/config" | ||
"github.com/pingcap/tidb/kv" | ||
"github.com/pingcap/tidb/types" | ||
"github.com/pingcap/tidb/util/timeutil" | ||
) | ||
|
@@ -625,6 +626,24 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string, | |
return "", nil | ||
} | ||
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value) | ||
case TiDBIsolationReadEngines: | ||
zz-jason marked this conversation as resolved.
Show resolved
Hide resolved
|
||
engines := strings.Split(value, ",") | ||
var formatVal string | ||
for i, engine := range engines { | ||
engine = strings.TrimSpace(engine) | ||
if i != 0 { | ||
formatVal += "," | ||
} | ||
switch { | ||
case strings.EqualFold(engine, kv.TiKV.Name()): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we also trim the spaces around each item and remove the duplicated items? For example, users may set the variable this way: set @@ tidb_isolation_read_engines = "tiflash, tikv, tiflash, tikv"; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
formatVal += kv.TiKV.Name() | ||
case strings.EqualFold(engine, kv.TiFlash.Name()): | ||
formatVal += kv.TiFlash.Name() | ||
default: | ||
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value) | ||
} | ||
} | ||
return formatVal, nil | ||
} | ||
return value, nil | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not call Name directly?