Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Include port in DiscoveryIgnoreReplicaHostnameFilters regexp matching #952

Merged
merged 5 commits into from
Aug 7, 2019

Conversation

dougfales
Copy link
Contributor

@dougfales dougfales commented Aug 5, 2019

Related issue: #923

This PR simply extends the hostname matching for the DiscoveryIgnoreReplicaHostnameFilters config setting to also include a server's port. By allowing the match on port number as well as hostname, you can prevent any replica instances (or transient gh-ost processes) which connect on a secondary port from showing up in Orchestrator by using a config setting like this:

  "DiscoveryIgnoreReplicaHostnameFilters": [ ".*:3307" ]

Notes:

  • See the related issue for an explanation of how this affects us with our gh-ost usage.
  • You will need to tell Orchestrator to Forget an already-discovered instance. This is not a change in functionality, just something I noticed during my testing.
  • contributed code is using same conventions as original code
  • code is formatted via gofmt (please avoid goimports)
  • code is built via ./build.sh
  • code is tested via go test ./go/...

Copy link
Collaborator

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

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

Thank you

@@ -18,7 +18,8 @@
"InstancePollSeconds": 5,
"DiscoveryIgnoreReplicaHostnameFilters": [
"a_host_i_want_to_ignore[.]example[.]com",
".*[.]ignore_all_hosts_from_this_domain[.]example[.]com"
".*[.]ignore_all_hosts_from_this_domain[.]example[.]com",
"a_host_with_extra_port_i_want_to_ignore[.]example[.]com:3307"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding an example!

@shlomi-noach shlomi-noach temporarily deployed to production/mysql_cluster=conductor August 6, 2019 07:51 Inactive
@shlomi-noach shlomi-noach merged commit a5822fd into openark:master Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants