mirror of https://github.com/sysown/proxysql
## (1) --no-plugins kill switch (issue #5680) When the plugin chassis is enabled (PROXYSQL40 builds), an operator upgrading to v4.0.0 gets the chassis active by default. If a critical chassis bug is found post-release, the recovery options today are: - Roll back the entire ProxySQL package to v3.x. - Edit the config file to comment out plugins=() and restart. Add a runtime kill switch — a CLI flag (and equivalent env var) that bypasses plugin loading entirely, regardless of config. Cuts the time-to-recover dramatically and reduces deployment anxiety. CLI: --no-plugins (gated by PROXYSQL40) Env: PROXYSQL_NO_PLUGINS=1 (CLI takes priority) Field: GloVars.no_plugins Wired through: when set, LoadConfiguredPlugins / InitConfiguredPlugins / StartConfiguredPlugins / StopConfiguredPlugins all become no-ops. LoadConfiguredPlugins emits a single startup log line so the operator knows the bypass took effect: Plugin chassis disabled by --no-plugins / PROXYSQL_NO_PLUGINS=1; skipping load of N configured plugin(s) Verified: --no-plugins appears in proxysql --help. The bypass message string is in the binary. Full end-to-end smoke against a Docker MySQL deferred to issue #5677. ## (2) plugin_manager_unit-t #62 + #88 (issue #5679) Test bug. The two assertions encoded the pre-ab9d5a103 contract that "destructor skips stop on plugins that were never started". Commitfix/test-mysqlx-plugin-load-phase-bab9d5a103("address deep-review findings") deliberately replaced that with init/stop pairing — every plugin where init() succeeded gets stop(), irrespective of whether start() ran. The change fixed a real leak: resources allocated in init() were not being released when start() failed. The tests were missed at the time. Flip both assertions: - "destructor does NOT invoke stop on plugins that were never started" → "destructor invokes stop on init-succeeded/never-started plugin (init/stop pairing)" - "destructor did NOT call stop on the second plugin (it never successfully started)" → "destructor stops the second plugin too — init succeeded, start failed (init/stop pairing)" Both flips include a comment explaining the contract change. ## (3) mysqlx_session_unit-t #33 + #34 (issue #5679) Test bug. The hardened auth flow (commit74e678006) calls resolve_backend_target() BEFORE sending Mysqlx::Session::AuthenticateOk. That helper requires a wired thread+config_store and an identity with a non-empty default_route. The test passed `nullptr` for thread and left default_route empty, so auth correctly transitioned to X_SESSION_CLOSING with code 4002 instead of OK. Lift the same default_test_thread() / default_test_config_store() helpers used by mysqlx_robustness_unit-t.cpp into mysqlx_session_unit-t.cpp, wire them into test_mysql41_auth_with_credentials, and add default_route="default_test_route" to the identity returned by the test's identity_lookup lambda. After this fix the test reports 60/60 oks (was 60/2-not-ok with the same plan). ## (4) mysqlx_message_dispatch_unit-t #1-15 (issue #5679) Test premise wrong. Each test_dispatch_* expected one handler() call to leave status_ exactly at CONNECTING_SERVER. That intermediate state isn't observable: forward_to_backend() sets to_process=true, the handler's `goto handler_again` loop re-enters the switch, and handler_connecting_server() runs in the same call. After commit55e90d1a7(which made start_connect() fail fast on an empty hostname instead of silently connecting to 0.0.0.0), the inner handler_connecting_server() correctly transitions to X_SESSION_CLOSING — so the asserted intermediate state is gone. Pre-55e90d1a7 the test passed by accident. Fixing properly means rewriting each test to use a real thread+ config_store fixture (à la mysqlx_robustness_unit-t.cpp's setup_authenticated_session) and asserting WAITING_SERVER_XMSG instead — a ~600-line rewrite tracked under issue #5679. Until then, skip the 15 affected sub-tests with a comment pointing at the issue: skip(17, "tracked under #5679: dispatch_* tests assume single-step handler(), need rewrite for the goto-handler_again re-entry"); (Skip count is 17 because test_dispatch_view_operations carries 3 sub-asserts; the other 14 carry 1 each.) Also fixes the related X_FAST_FORWARD reference at line 424 (retired together with MysqlxWorker in commit79cac4c97), so the file compiles with -DMYSQLX_TEST_BUILD. Net effect: 5 failures + hang → 3 clean failures + 17 clean skips + clean exit. The remaining 3 (assertions 21, 29, 43) have similar root causes and stay tracked under #5679 for the proper rewrite. ## Verified After this commit (PROXYSQLGENAI=1 NOJEMALLOC=1 WITHASAN=1): - plugin_manager_unit-t: 96 ok / 0 not-ok (was 94 ok / 2 not-ok) - mysqlx_session_unit-t: 60 ok / 0 not-ok (was 58 ok / 2 not-ok) - mysqlx_message_dispatch_unit-t: 46 ok / 3 not-ok (was 5 not-ok + hang) - mysqlx_robustness_unit-t: 74 / 0 — unchanged - mysqlx_compression_unit-t: 64 / 0 — unchanged - mysqlx_config_store_concurrent_unit-t: 15 / 0 — unchanged - ASAN: 0 errors across all of the above
parent
09c15d6d54
commit
83725ea4e5
Loading…
Reference in new issue