Context
PR #5554 adds mysql-resolution_family to control IPv4/IPv6 resolution in the DNS cache resolver thread. However, there are two gaps:
1. DNS cache bypass path
When the DNS cache does not contain an entry (cache miss), mysql_connection.cpp:connect_start_DNS_lookup() passes the raw hostname to mysql_real_connect, which resolves it via the MariaDB client library (pvio_socket.c) using hardcoded AF_UNSPEC. The resolution_family setting has no effect in this path.
Fixing this requires either:
- Patching the MariaDB client library to accept an
ai_family hint
- Pre-resolving the hostname in ProxySQL before calling
mysql_real_connect (even on cache miss)
2. PgSQL equivalent
pgsql-resolution_family should be added with the same semantics, covering the PgSQL DNS resolver thread and connection paths.
Related code paths using hardcoded AF_UNSPEC
lib/mysql_connection.cpp:962 — DNS cache miss fallback (via MariaDB client lib)
lib/GTID_Server_Data.cpp:160 — GTID server connections
lib/ProxySQL_Statistics.cpp:1913 — statistics connections
References
Context
PR #5554 adds
mysql-resolution_familyto control IPv4/IPv6 resolution in the DNS cache resolver thread. However, there are two gaps:1. DNS cache bypass path
When the DNS cache does not contain an entry (cache miss),
mysql_connection.cpp:connect_start_DNS_lookup()passes the raw hostname tomysql_real_connect, which resolves it via the MariaDB client library (pvio_socket.c) using hardcodedAF_UNSPEC. Theresolution_familysetting has no effect in this path.Fixing this requires either:
ai_familyhintmysql_real_connect(even on cache miss)2. PgSQL equivalent
pgsql-resolution_familyshould be added with the same semantics, covering the PgSQL DNS resolver thread and connection paths.Related code paths using hardcoded
AF_UNSPEClib/mysql_connection.cpp:962— DNS cache miss fallback (via MariaDB client lib)lib/GTID_Server_Data.cpp:160— GTID server connectionslib/ProxySQL_Statistics.cpp:1913— statistics connectionsReferences
mysql-resolution_familyto control IPv4/IPv6 hostname resolution #5554 — initialmysql-resolution_familyimplementation