pub enum MysqlProxyKind {
Direct,
ProxySql,
MaxScale,
Multiplexed,
}Expand description
What the MySQL connection is actually talking to.
Used to:
- decide which warning (if any) to print at connect time,
- tag the
executing query (connection=...)debug log so operators can distinguish direct vs proxied traffic when reading logs after the fact.
Detection happens once at connect time via [detect_mysql_proxy_kind].
pub for integration-test reachability via MysqlSource::proxy_kind();
same “no external API contract” disclaimer applies as for the rest of
rivet::source::mysql::*.
Variants§
Direct
Direct connection to a MySQL server — no proxy detected.
ProxySql
ProxySQL: detected via either the @@version_comment signature or
@@proxy_version (a ProxySQL-only system variable).
MaxScale
MariaDB MaxScale: detected via @@version_comment containing
“maxscale”. MaxScale’s readwritesplit and readconnroute routers
do not multiplex by default but they can still rewrite or block
queries — worth surfacing to the operator.
Multiplexed
An unknown transaction-mode multiplexer: detected because
CONNECTION_ID() returned different values across two consecutive
queries on the same mysql::Conn. This catches in-house balancers,
HAProxy-with-MySQL-mode setups, and ProxySQL/MaxScale instances that
hide their banner.
False negatives are possible when the proxy’s backend pool_size is 1 (the same physical backend is always reused).
Implementations§
Source§impl MysqlProxyKind
impl MysqlProxyKind
Sourcepub fn is_proxy(self) -> bool
pub fn is_proxy(self) -> bool
True for any non-direct connection (is_proxy() == false only for
MysqlProxyKind::Direct).
#[allow(dead_code)] because the binary compilation unit (which
re-declares mod source) does not reference this; the lib + tests do.
Same pattern as MysqlSource::from_pool.
Trait Implementations§
Source§impl Clone for MysqlProxyKind
impl Clone for MysqlProxyKind
Source§fn clone(&self) -> MysqlProxyKind
fn clone(&self) -> MysqlProxyKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MysqlProxyKind
impl Debug for MysqlProxyKind
Source§impl PartialEq for MysqlProxyKind
impl PartialEq for MysqlProxyKind
Source§fn eq(&self, other: &MysqlProxyKind) -> bool
fn eq(&self, other: &MysqlProxyKind) -> bool
self and other values to be equal, and is used by ==.impl Copy for MysqlProxyKind
impl Eq for MysqlProxyKind
impl StructuralPartialEq for MysqlProxyKind
Auto Trait Implementations§
impl Freeze for MysqlProxyKind
impl RefUnwindSafe for MysqlProxyKind
impl Send for MysqlProxyKind
impl Sync for MysqlProxyKind
impl Unpin for MysqlProxyKind
impl UnsafeUnpin for MysqlProxyKind
impl UnwindSafe for MysqlProxyKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.