-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
infoschema: fix tidb version showed in cluster_info table and update the go.mod for new sysutil #16003
Conversation
/run-unit-test |
Codecov Report
@@ Coverage Diff @@
## master #16003 +/- ##
===========================================
Coverage 80.3136% 80.3136%
===========================================
Files 506 506
Lines 136226 136226
===========================================
Hits 109408 109408
Misses 18301 18301
Partials 8517 8517 |
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.
LGTM
infoschema/tables.go
Outdated
// FormatVersion make TiDBVersion consistent to TiKV and PD. | ||
func FormatVersion(TiDBVersion string) string { | ||
var version string | ||
nodeVersion := TiDBVersion[strings.LastIndex(TiDBVersion, "TiDB-")+len("TiDB-"):] |
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.
Check len(TiDBVersion) > n
before use
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.
+1.
Since the TiDBVersion
maybe equal the config ServerVersion
, Add more case for this, such as xxx
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.
Test it need change the serverVersion
config, so test it locally and show the result in introduction
.
- When not set the
serverVersion
, it would use the default version, and format it incluster_info
. - When the user set the
serverVersion
(this would hardly happend), it would use theserverVersion
and not do the format.
…to fix_tidb_version
/run-check_dev_2 |
…to fix_tidb_version
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.
LGTM
Your auto merge job has been accepted, waiting for 16219, 16138 |
|
||
// The user hasn't set the config 'ServerVersion'. | ||
if isDefaultVersion { | ||
nodeVersion = TiDBVersion[strings.LastIndex(TiDBVersion, "TiDB-")+len("TiDB-"):] |
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.
Is there a scenario where "TiDBVersion" is not the default format, but "isDefaultVersion" is true?
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.
No,this would be never happened,because the "TiDBVersion" also comes from mysql.ServerVersion
, and when the user not set the serverVersion
,the mysql.ServerVersion
would be the default version which make isDefaultVersion
become true.
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.
OK. I see node.Version
is come from ServerInfo
so ask this question.
/run-all-tests |
/merge |
Your auto merge job has been accepted, waiting for 16142, 16139, 16137, 16204 |
/run-all-tests |
@reafans merge failed. |
/run-integration-copr-test |
/run-integration-copr-test tikv=pr/7383 |
/run-check_dev_2 |
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #18413 |
What problem does this PR solve?
The version of TiDB is not consistent with TiKV and PD.
What is changed and how it works?
Proposal: xxx
What's Changed:
before:
this pr : not set the serverVersion, use
select Version()
would get the default version. AndCLUSTER_INFO
would get the format version.When set the serverVersion to "8.0.1" in config.toml,
select Version()
andCLUSTER_INFO
would get the version which user set:How it Works:
Check List
Tests