Skip to content
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

Add config advertise-addr for drainer #634

Merged
merged 9 commits into from Jun 18, 2019

Conversation

@suzaku
Copy link
Member

suzaku commented Jun 13, 2019

What problem does this PR solve?

Fix #265

What is changed and how it works?

Add advertise-addr config for drainer, the default value is compatible
with older version, which is the same as listen-addr.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

@suzaku suzaku force-pushed the suzaku:advertise-addr-for-drainer branch from ce56fe1 to 6ef58f4 Jun 13, 2019
@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 13, 2019

/run-all-tests

@suzaku suzaku force-pushed the suzaku:advertise-addr-for-drainer branch 2 times, most recently from df8f011 to 902be22 Jun 14, 2019
@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 14, 2019

/run-all-tests

drainer/config.go Outdated Show resolved Hide resolved
drainer/config.go Outdated Show resolved Hide resolved
@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 14, 2019

/run-all-tests

drainer/config.go Outdated Show resolved Hide resolved
Copy link
Member

kennytm left a comment

Please add a test showing that, after calling .adjustConfig(), an empty AdvertiseAddr will be filled in with Addr, and an existing AdvertiseAddr will not get overridden.

Rest LGTM.

@suzaku suzaku force-pushed the suzaku:advertise-addr-for-drainer branch from 73ffe6f to b33fb96 Jun 17, 2019
@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 17, 2019

Please add a test showing that, after calling .adjustConfig(), an empty AdvertiseAddr will be filled in with Addr, and an existing AdvertiseAddr will not get overridden.

Rest LGTM.

It seems like there's already one such test for util.AdjustString here: https://github.com/pingcap/tidb-binlog/blob/master/pkg/util/util_test.go#L207

@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 17, 2019

/run-all-tests

drainer/config.go Outdated Show resolved Hide resolved
drainer/config.go Outdated Show resolved Hide resolved
drainer/config.go Outdated Show resolved Hide resolved
@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 17, 2019

/run-all-tests

@GregoryIan

This comment has been minimized.

Copy link
Collaborator

GregoryIan commented Jun 17, 2019

LGTM

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Jun 17, 2019

It seems like there's already one such test for util.AdjustString here: https://github.com/pingcap/tidb-binlog/blob/master/pkg/util/util_test.go#L207

I mean specifically a test for AdvertiseAddr and Addr, as AdjustString working correctly isn't a proof that it's used correctly.

@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 17, 2019

/run-all-tests

@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 17, 2019

It seems like there's already one such test for util.AdjustString here: https://github.com/pingcap/tidb-binlog/blob/master/pkg/util/util_test.go#L207

I mean specifically a test for AdvertiseAddr and Addr, as AdjustString working correctly isn't a proof that it's used correctly.

OK, new cases added in TestAdjustConfig.

Copy link
Member

kennytm left a comment

LGTM

@suzaku

This comment has been minimized.

Copy link
Member Author

suzaku commented Jun 18, 2019

/run-all-tests

@kennytm kennytm added status/LGT2 and removed status/LGT1 labels Jun 18, 2019
@GregoryIan GregoryIan merged commit 968b6ac into pingcap:master Jun 18, 2019
3 checks passed
3 checks passed
idc-jenkins-ci-binlog/build Jenkins job succeeded.
Details
idc-jenkins-ci-binlog/check Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
@suzaku suzaku deleted the suzaku:advertise-addr-for-drainer branch Jun 18, 2019
suzaku added a commit to suzaku/tidb-binlog that referenced this pull request Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.