Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd store support for ProxySQL #129
Conversation
|
This repo provides a Docker-based playground for MySQL+ProxySQL+Freno, using the branch from this PR to build Freno: https://github.com/timvaillancourt/proxysql-freno To test it out:
You should get the following output once the setup completes:
|
Since I'm not very familiar with ProxySQL: what does Assuming ONLINE actually means "healthy": (skip next section if that's not the case)Watch out for this trap. What you want to collect are servers that should be healthy, not servers that report in proxy as healthy. To explain, let's look at HAProxy: suppose you have 10 replicas, all listed in HAProxy and are all healthy. Great! Now one of them starts lagging. Within a few seconds, HAProxy will notice it's lagging and report it as Instead, |
@shlomi-noach hello I built this PR by copying the Vitess store in Your question has made me realize I need to add requirements for this ProxySQL support in a Currently this PR considers Thankfully, the
I believe that changing the logic to probe servers with either This solution avoids deploying http-based checks, something that isn't common on ProxySQL-based deployments Does this solution check out @shlomi-noach? |
I'm again not very familiar with ProxySQL probe statuses, but this seems to make sense. If a server that is supposed to be serving can be in either
I'm merely guessing |
@shlomi-noach thanks for all the reviews! In my testbed environment I am not deploying any HTTP healthcheck server on MySQL replicas and it all just works My understanding was HTTP checks was opt-in or in the HaProxy support only. Let's see! In a ProxySQL/Vitess use case(s) the HTTP check would probably be unnecessary |
@shlomi-noach it turns out if the Example:
This explains why everything just-works on my ProxySQL/Freno testbed where there is no |
|
LGTM |
timvaillancourt commentedAug 7, 2020
•
edited
This PR adds support for ProxySQL as a Freno "store" for retrieving MySQL inventory
Freno connects to ProxySQL's admin port (MySQL protocol) to query the
stats.stats_mysql_connection_pooltable to gather MySQL inventory.stats.stats_mysql_connection_poolcan be queried using the read-only ProxySQLstatsuser, limiting any security exposure to the ProxySQL admin portProxySQL backends with the status of
ONLINEandSHUNNED_REPLICATION_LAGwill be considered for Freno probes, all other nodes are considered unhealthy and are skippedA gotcha worth noting:
stats.stats_mysql_connection_poolcan return a false-positiveONLINEstate for servers immediately after aLOAD MYSQL SERVERS TO RUNTIMEbut importantly before the first healthcheck to the server. This is because thestatusof servers inmain.mysql_serversis assumed to be true after being loaded to runtimeTo mitigate this gotcha, nodes that are considered unhealthy are cached briefly in the
ignoreServerCacheand are ignored for polling so that we don't mistakenly consider a node to be healthy before ProxySQL actually health-checks it (and potentially considers it unhealthy)cc @shlomi-noach here (because it won't let me tag you as an official reviewer😢 )