Skip to content

Allow start local cluster using a provided tablet host name#5042

Merged
sougou merged 1 commit intovitessio:masterfrom
kalfonso:kalfonso.190730-vttestserver-localhost
Aug 4, 2019
Merged

Allow start local cluster using a provided tablet host name#5042
sougou merged 1 commit intovitessio:masterfrom
kalfonso:kalfonso.190730-vttestserver-localhost

Conversation

@kalfonso
Copy link
Copy Markdown
Contributor

This helps fix a name resolution problem when initializing the tablet. If flag "tablet_hostname" is not provided it will be derived from the OS' hostname. The way it is implemented there is not guarantee that net.LookupHost(os.HostName()) will return a valid IP for certain local env dns configs, i.e, in Mac OS X, hostname can be configured using the system's resolver which is not used by net.LookupHost

Reference: init_tablet.go:151

Signed-off-by: Karel Alfonso Sague kalfonso@squareup.com

This helps fix a name resolution problem when initializing the tablet. If flag "tablet_hostname" is not provided it will be derived from the OS' hostname. The way it is implemented there is not guarantee that ```net.LookupHost(os.HostName())``` will return a valid IP for certain local env dns configs, i.e, in Mac OS X, hostname can be configured using the system's resolver which is not used by ```net.LookupHost```

Reference: init_tablet.go:151

Signed-off-by: Karel Alfonso Sague <kalfonso@squareup.com>
@kalfonso kalfonso requested a review from sougou as a code owner July 31, 2019 04:19
Copy link
Copy Markdown
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

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

We should probably fix the underlying problem to make the lookup function more robust, but this will do as make-shift workaround.

@sougou sougou merged commit af954f0 into vitessio:master Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants