-
Notifications
You must be signed in to change notification settings - Fork 66
Check if the cluster satisfies the version requirements before starting #61
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/run-all-tests |
/run-integration-test I suspect the Jenkins failure is caused by the close/open gRPC messages being reordered (e.g. |
@holys PTAL |
@@ -40,6 +43,12 @@ const ( | |||
closeEngineMaxRetry = 5 | |||
) | |||
|
|||
var ( | |||
requiredTiDBVersion = *semver.New("2.0.4") |
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 use pointer?
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.
lightning/common/util.go
Outdated
@@ -210,3 +213,21 @@ func isRetryableError(err error) bool { | |||
func UniqueTable(schema string, table string) string { | |||
return fmt.Sprintf("`%s`.`%s`", schema, table) | |||
} | |||
|
|||
func GetJSON(client *http.Client, url string, v interface{}) error { |
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.
Please comment that v must be a pointer type.
LGTM Good job! |
@csuzhangxc PTAL |
Turns out the PD and TiKV version reporting is added quite recently in the 2.1 branch (tikv/pd#1148, pingcap/kvproto#285, tikv/tikv#3319). This means if we want to target the 2.0 branch we cannot check for PD and TiKV's versions. |
@kennytm Should we do something when there is no version information in PD and TiKV? |
@holys I'd like to just comment out the PD and TiKV check until 2.1 is stabilized, and then bump the requirements. Or we could find a feature which is only present on 2.0.4+ and do feature detection. |
25cfd1a
to
f31ef92
Compare
/run-integration-test @holys @csuzhangxc PTAL again |
LGTM again |
Also, make the mock import operation only wait while we're still opening engines to speed up the test.
In semver, '2.0.4-1 < 2.0.4', so we need to properly skip the unrelated portions of the version.
TiKV and PD's versions are exposed before 2.1, so we can't rely on their APIs to verify for 2.0.4+. Since the only reason we need 2.0.4+ is the SwitchMode gRPC interface, we instead inspect if SwitchMode is unimplemented and display a user-friendly message on stderr.
f31ef92
to
f800ab4
Compare
/run-all-tests (just rebased on top of master, nothing is changed) |
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
Version check involving
tikv-importer
isn't included yet.In the future we could add more sanity checks from the checklist (e.g.
table-concurrency
should be ≤tikv-importer
'smax-open-engines
).