-
Notifications
You must be signed in to change notification settings - Fork 316
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
Fix data_dir of tiflash when import cluster #612
Conversation
fix #611 import command will only get data_dir from inventory.ini and start script of tiflash and the start script contains the only config file flag, so it can not get the truly use path and use the default value.
Codecov Report
@@ Coverage Diff @@
## master #612 +/- ##
==========================================
+ Coverage 51.20% 51.32% +0.12%
==========================================
Files 225 225
Lines 16573 16606 +33
==========================================
+ Hits 8486 8523 +37
+ Misses 6901 6898 -3
+ Partials 1186 1185 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -123,6 +125,21 @@ func parseDirs(user string, ins spec.InstanceSpec, sshTimeout int64) (spec.Insta | |||
newIns.DeployDir = strings.Trim(strings.Split(line, " ")[1], "\"") | |||
continue | |||
} | |||
|
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.
It's better to add some tests.
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.
forgot to commit the file: 6dd6f95
but it only covers about parsing the file and get info
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
err := parseTiflashConfigFromFileData(spec, data) | ||
c.Assert(err, check.IsNil) | ||
|
||
c.Assert(spec.DataDir, check.Equals, "/data1/test-cluster/leiysky-ansible-test-deploy/tiflash/data/db") |
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.
TiFlash supports multiple comma seperated paths like /path/1,/path/2
, we should also add cases for that.
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.
here we just need to make sure DataDir is the same as path
in tiflash.toml, so I don't think we need to add suck case here.
What problem does this PR solve?
fix #611
import command will only get data_dir from inventory.ini and start
script of tiflash and the start script contains the only config file
flag, so it can not get the truly use path and use the default value.
What is changed and how it works?
parse the config file of tiflash to get
path
andtmp_path
and set it inDataDir
andTmpDir
in spec.test