mirror of https://github.com/sysown/proxysql
The ER_ACCESS_DENIED_ERROR (1045) eviction hook in
handler_again___status_CONNECTING_SERVER fired unconditionally on any
1045 for the session's username. A regular mysql_users user with a
stale stored hash that triggered 1045 would silently evict an
unrelated pass-through cache entry for the same username.
Functionally this is harmless (next pass-through connect re-probes
and re-populates the cache), but it creates needless churn on
rotation events for users who aren't using pass-through at all,
and the metric cache_invalidations becomes noisy.
Add a per-session @c passthrough_credential bool on MySQL_Session:
- Initialized to @c false in MySQL_Session::reset() alongside the
other auth-state flags.
- Set to @c true in PPHR_verify_password on a cache hit (the
credential we're verifying with literally came from the cache).
- Set to @c true in
handler_again___status_AUTHENTICATING_BACKEND_FOR_CLIENT after
a probe success (we just inserted the cleartext into the cache,
so a future ER 1045 on this session means our just-cached
cleartext is stale).
The eviction hook now checks this flag before evicting; non-
pass-through sessions cannot invalidate the cache. This makes
cache_invalidations a clean signal for "pass-through sessions
whose cached cleartext was rejected by the backend".
Discovered as N4 / a GA-blocker by the production-readiness
subagent during the round-3 deep review of PR #5810.
docs/passthrough-auth-spec
parent
d907797944
commit
a050d0d431
Loading…
Reference in new issue