Skip to content

resolution_family: extend to DNS cache bypass path and PgSQL #5555

@renecannao

Description

@renecannao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions