If you are using MySQL InnoDB Cluster (Group Replication) with ProxySQL, you should be familiar with the 2 functions and 1 view required in
SYS Schema that ProxySQL uses to see if a node is online, partitioned or not, and if it’s lagging or not (see link1 and link2).
I received recently a very valuable contribution from Bruce DeFrang that fixes a bug in one of the function that were added to
In fact, Bruce discovered that when a node was in
RECOVERING state, it was not count in the Primary Partition. This could lead in having the only
ONLINE Primary Master considered as being partitioned and therefore, ProxySQL won’t consider the node as a valid candidate for routing the queries to it.
I already updated the original gist with these addition, so if you are linking it somewhere, you have now the fixed version.
For the others, here is the file: addtion_to_sys_8.0.2.sql
The same file is of course valid for all MySQL >= 8.0.2.
In conclusion, thank you Bruce for considering MySQL Group Replication and thank you for sharing your comments with me and for contributing back your fix.