-
Notifications
You must be signed in to change notification settings - Fork 312
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
support ticdc data dir #1372
support ticdc data dir #1372
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1372 +/- ##
===========================================
+ Coverage 25.26% 54.13% +28.86%
===========================================
Files 266 291 +25
Lines 20589 22494 +1905
===========================================
+ Hits 5202 12177 +6975
+ Misses 14585 8383 -6202
- Partials 802 1934 +1132
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/run-all-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.
Could you add some tests?
E.g., tests like
tiup/pkg/cluster/spec/spec_test.go
Lines 35 to 48 in 2faf4c9
func (s *metaSuiteTopo) TestDefaultDataDir(c *C) { | |
// Test with without global DataDir. | |
topo := new(Specification) | |
topo.TiKVServers = append(topo.TiKVServers, &TiKVSpec{Host: "1.1.1.1", Port: 22}) | |
data, err := yaml.Marshal(topo) | |
c.Assert(err, IsNil) | |
// Check default value. | |
topo = new(Specification) | |
err = yaml.Unmarshal(data, topo) | |
c.Assert(err, IsNil) | |
c.Assert(topo.GlobalOptions.DataDir, Equals, "data") | |
c.Assert(topo.TiKVServers[0].DataDir, Equals, "data") |
Rest LGTM
/run-all-tests |
pkg/cluster/spec/cdc.go
Outdated
if semver.Compare(clusterVersion, "v4.0.13") >= 0 && clusterVersion != "v5.0.0-rc" { | ||
configFileSupported = true | ||
dataDirSupported = 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.
better use a dedicated if block, so that the error message can be specific to data_dir
.
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.
and did you make sure v5.0 series versions except v5.0.0-rc
support the --sort-dir
argument?
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.
yes, it's checked at the source code level.
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.
better use a dedicated if block, so that the error message can be specific to
data_dir
.
I don't think we have to throw an error message on data-dir
, the reason is described above.
46e617d
to
6439c29
Compare
/lgtm |
@overvenus: Thanks for your review. The bot only counts In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-all-tests |
/lgtm |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
…JinLingChristopher/tiup into ling.jin/support-ticdc-data-dir
/merge |
This pull request has been accepted and is ready to merge. Commit hash: c2ec4db
|
What problem does this PR solve?
For TiCDC, it might create a
sort-dir
to store temporary files for sort. In this PR, adddata-dir
to TiCDC, which can be used to store any temporary files generated by TiCDC instance.What is changed and how it works?
DataDir
field atCDCSpec
There are two scenarios:
version < v4.0.13
, does not show data-dir in confirm information. even user set data-dir, it does not work.version >= v4.0.13 && version != v5.0.0-RC
, show data-dir, and create it, and start CDC instance by using it.Check List
Tests
Code changes
Side effects
Related changes
Release notes:
NONE