Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

config: automatically discover tidb.pd-addr and tidb.port if not provided #173

Merged
merged 8 commits into from
May 8, 2019

Conversation

kennytm
Copy link
Collaborator

@kennytm kennytm commented Apr 25, 2019

What problem does this PR solve?

Part of #131.

The setting tidb.port and tidb.pd-addr can be automatically discovered through the status API, allowing these to be omitted while Lightning could still obtain the correct values.

What is changed and how it works?

Change the default values of tidb.port from 4000 to 0 and tidb.pd-addr from "127.0.0.1:2379" to "".

If these values are empty, reach for http://{tidb.host}:{tidb.status-port}/settings, and use these settings instead.

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Possible performance regression
  • Increased code complexity

Related changes

  • Need to update the documentation

@kennytm kennytm added status/PTAL This PR is ready for review. Add this label back after committing new changes priority/normal type/enhancement Performance improvement or refactoring labels Apr 25, 2019
@kennytm
Copy link
Collaborator Author

kennytm commented Apr 25, 2019

/run-all-tests

@IANTHEREAL
Copy link
Collaborator

Rest LGTM

@kennytm
Copy link
Collaborator Author

kennytm commented Apr 29, 2019

/run-all-tests tidb=master tikv=master pd=master

TiDB team says it is useless and TiDB won't work with port-forwarding.
@IANTHEREAL
Copy link
Collaborator

LGTM

@kennytm kennytm added status/LGT1 One reviewer already commented LGTM (LGTM1) and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Apr 30, 2019
@lonng
Copy link
Contributor

lonng commented May 7, 2019

@kennytm Please resolve the conflicts

@kennytm
Copy link
Collaborator Author

kennytm commented May 8, 2019

PTAL @lonng

Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kennytm kennytm added status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) and removed status/LGT1 One reviewer already commented LGTM (LGTM1) labels May 8, 2019
@kennytm
Copy link
Collaborator Author

kennytm commented May 8, 2019

/run-all-tests

@kennytm kennytm merged commit f8385c7 into master May 8, 2019
@kennytm kennytm deleted the kennytm/auto-discover-pd branch May 8, 2019 03:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) type/enhancement Performance improvement or refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants