mirror of https://github.com/sysown/proxysql
feature/aws-rds-monitor
v3.0_fix_ci-mysqlx-cache-and-soak
GH-Actions
v3.0
v3.0_fix_codecov-coverage-path-prefix
issue-1288-load-mysql-variables-feedback
ci/fix-pgsql-socket-g1-cache-key
v3.0_fix_ci-mysqlx-fetch-depth
cleanup/drop-unreachable-port-defaults
feature/pgsql-native-backend-protocol
fix/pgsql-unix-socket
ci-pgsql-socket-g1
v3.0_fix_coverage-gcov-prefix-strip
fix/pgsql-omit-port-zero
aws-rds-bg
fix/jemalloc-page-size-auto-detect
docs/passthrough-auth-spec
feature/ci-codecov-tap-all-groups-callers
fix/run-tests-backtick-leak
ci/zstd-level-15
feature/ci-codecov-tap-all-groups-callees
v3.0_partition-fairness
feature/ci-codecov-tap-legacy-g2
v3.0_partition-gate
fix/ci-cache-restore-path
v3.0_fix-stale-pause-until
feature/perf-improvements-test2
fix/kill-proxysqlgenai-build-flag
feat/passthrough-auth
ci-trigger-tolerate-cleanup-401
fix/5790-mariadb-collation-255
fix/parsersql-1.0.3-pg-set-fixes
issue_5639
pgsql_dns_cache
fix/5755-followup-typecast-digest-fixtures
v3.0_merge-5776-5784
v3.0_latency_consistency_improvement
fix/galera-g5-cluster-start
fix/ghcr-pull-retry
v3.0_cap_violation_5767
ci-mariadb10-galera-GH-Actions
ci/fix-gr-g5-cluster-start
ci-mysql84-gr-g1-g9-GH-Actions
perf/pull-ci-base-from-ghcr
fix/split-test-groups
fix/rename-set-parser-workflow
gh-actions/add-set-parser-algorithm-3-g1
fix/4760-advertise-lenenc-auth-capability
feature/mysqlx-stack-consolidated
feature/mysqlx-asan-coverage-docker-isolation
fix/ci-unit-tests-tsan-project-name
feature/mysqlx-tsan-v3-companion
feature/ci-builds-add-tsan-matrix
ci-reduce-polling-interval
feature/mysqlx-tsan-workflow-only
feature/mysqlx-ci-validation-workflows
feature/mysqlx-test-leak-cleanup
feature/mysqlx-behavioural-tap
feature/mysqlx-parity-cleanup
ci-g5-enable-cluster
feature/mysqlx-tls-passthrough
feature/mysqlx-asymmetric-tls
feature/mysqlx-state-machines
feature/build-tsan-plumbing
feature/mysqlx-observability-p0
fix/mysqlx-review-findings
v3.0-test-ci
ci/fix-mysql-apt-key-expired-v2
ci/fix-mysql-apt-key-expired
mariadb-rpl-helper
fix-fc-parsing
ci/fix-upload-artifact-eacces
ci/fix-cache-prune-permissions
ci/shrink-test-cache
ci/fix-tap-build-target
ci/gh-actions-readme-pointer
ci/fix-mysql84-infradb-label
ci/add-missing-group-reusables
infra-mysql57-binlog
feature/pgbouncer-compat
v3.0_pgsql_sslkeylog_5281
fix/5554-resolution-family-limitation
fix/3p-ci-error-handling
v3.0-5493
v3.0-ci260322_cluster
copilot/extract-server-selection-algorithm
copilot/extract-health-state-logic
copilot/extract-query-rule-matching-logic
copilot/extract-connection-pool-logic
v3.0-set_parser_v3
feature/arm-builds
release-notes-3.0.6-4.0.6-draft
v3.0.6-add-tap-test_stats_table_check
v2.7.3-test260221
v4.0-mcp-stats
copilot/uninstall-amazon-linux-2023
fix-prometheus-labels-test
tap-mcp-client
agent-skill-tap-test
v4.0-tsdb1
v3.0-fix_5256
gh-pages
feature/modern-docs
v4.0
v4.0-fix-vec-search
v4.0_rag_sys_prompt
v4.0_rag_mcp
v4.0-tsdb
feature/v4-docs-init
otel_system_libs
otel_clean
v3.0-5288
otel
otel_2
fix/postgresql-cluster-sync
v3.0-releate_notes_scripts_fixes
test_gh-actions_triggers
postgresql-digest-testing-improvement
v3.0_select_auto_commit
v3.0-5218
fix-5221
fix/5186-proxysql-stop-admin-crash
v3.0-4951
add-claude-github-actions-1763877527835
fix-rpm
v3.0-DS_crash
add-claude-github-actions-1763663272333
add-claude-github-actions-1763663091346
add-claude-github-actions-1763663091411
add-claude-github-actions-1763476725261
add-claude-github-actions-1763476725489
v3.0_optimizations_and_stability
v2.7.3.1
v3.0.3-upgrade_json
v3.0.sonar-cli
v3.0.sonar-config
otel-tracepoint
v3.0.2-merge-upgrade_deps-add_new_distros
v3.0.2-upgrade_deps
v3.0.2-add_new_distros
v3.0-add_more_testing_groups
v3.0-upgrade_prometheus-cpp
v3.0-upgrade_json
v3.0-upgrade_sqlite3
v3.0-upgrade_libmicrohttpd
v3.0-upgrade_curl
v3.0-add_centos10_builds
v3.0-add_fedora42_builds
v3.0_PG_PrepStmt
v3.0-sliced_groups
v3.0_auth_negotiation
v2.7
v2.7-fix_run_name
v3.0_4799_4827
v3.0-3687
v2.7-pmm_runtime_servers_metrics
v2.7-4839
v2.7-4841
v2.7-bump_version_to_2.7.3
2.6.6-4841
v2.x_pg_PrepStmtBase_240714
v3.0-4803-4817
v3.0-4803
v2.7-minorBugs
v3.0-privates
v2.x-logging_mem_2
v2.7_fix
v2.7_amd64_build_fix
v2.7-fix_aux_threads_ssl_leaks
v2.7-fix_ssl_params_leak
v2.7-rm_malloc_conf_on_version
v2.7_compression
v2.7-actions-add-3p-tests-parameter
none
v2.7-fix_hang_on_resume
v2.x-logging_mem
v2.7_servers_defaults
v2.7-mariadb_column_metadata_integrity_check
ssl_optimization
v2.7_reg_test_4716_single_semicolon
v2.7_issue_4707_threshold_resultset_size
v2.7_reg_test_4723_query_cache_stores_empty_result
2.7_randomized_cache_ttl
v3.0_fix_multiple_builds
v3.0_servers_defaults
v2.7-update_actions_triggers_v2
v2.7-update_actions_triggers
v2.6
v2.6.x-update_triggers
v2.6-4646
v2.7.1-update_actions
v2.x
v2.6.x-testing-global-multiplexing-disabled
use-wrlock-in-dns-cache-empty
v2.6.x-fix-darwin
v2.x-admin_list_ciphers
v2.x-sqlite3_pass_exts
v2.x-tap_tests_opt_ssl
v2.6.0-update_to_libhttpserver_v0.19
v2.x_router_2ports
v2.6.0-update_to_openssl_v3.1.5
v2.x-2411025
v2.x-profiling_poc1
v2.x_sha2pass_draft2
v2.x-webui_fixes
v2.6.0-more-makefile-fixes
v2.x-20230914_test
v2.x-20230913_test
v2.5.5-branch
v2.5.5-branch_255_patches
v2.x-aurora_autodiscovery-refactor_cluster_mysql_servers-gr_bootstrap_mode_2
v2.x_mysql_connector_j_fixes
v2.6-deprecate_old_clickhouse
v2.x_refactor_cluster_mysql_servers
v2.x-aurora_autodiscovery
v2.x-zd70545
v2.x-aurora_autodiscovery_shunned_promotion
v2.x-tap20230609
v2.x-test20230530
v2.x_sha2pass_draft2-TEST
v2.x-session_track_system_variables_v2
v2.x-status-variables-for-set-stmts
v2.x-enable_session_state_trackers
v2.x-increase-logging-eof_fast_forward-t
v2.x-3863-special-query
v2.x-session_track_system_variables
v2.x_refactor_read_only_action
v2.x_sha2pass_draft1
v2.2.0-sqliteserver_read_only
v2.x-digest_umap_aux-comparison
v2.4.8
v2.x-4105_4114
v2.x-3583-server_closed_conn
v2.x-group_replication_rework-SHUNNED_promotion
v2.1.0-var-global-multiplex
v2.x-CI-hostname-tap-test-fixes
v2.x-limit-version-check
v2.x-fix_deprecate_eof_warning
v2.x-3698
v2.x_tidb_replica_read
v2.x-HostGroups_attributes
v2.0.18.221009
v2.x-ci_reg_test_3273_ssl_con
TAP_test_restapi
v2.x-tap_tests_groups
v2.x-tap_test_sqlite3_server-t
PRS_3888_3903_2
PRS_3888_3903
v2.x_code_refactor_2206
v2.x-multipacket_poc_1
v2.x-impr_hg_latency_obsv
v2.x-gcc-warnings
v2.x-hg_lock_session_id
v2.x-3768
v2.x-3371
v2.x-ci_verifications
v2.x-thread_local_qps_limit
v2.x-parser_table
v2.1.1-3207
v2.x-qps_limits
v2.x-3711
v2.x-3642
v2.x-3674
v2.x-ssl3_warnings
V2
v2.3.2
v2.3.2_3646_3647
v2.x-client_err_limit_conn_timeout
v2.x-keep_multiplexing_regression_fix
v2.3.2-3628
v2.2.2-to-v2.3.0-7
v2.2.2-to-v2.3.0-7_merge
v2.2.2-to-v2.3.0-6
v2.2.2-to-v2.3.0-6_merge
v2.2.2-to-v2.3.0-5
v2.2.2-to-v2.3.0-4
v2.2.2-to-v2.3.0-3
v2.2.2-to-v2.3.0-2
v2.2.2-to-v2.3.0-1
v2.3.1
v2.0.14-70226
v2.3.0
v2.x-client_err_limit-gr_replication_lag_action
v2.2.2
v2.2.1-3603
v2.2.1-centos7-ASAN
v2.2.1
v2.2.1-3601
v2.2.1-3599
v2.2.1-3597
v2.2.1-3595
v2.2.0-restapi_server_exc_log
v2.x-3574
v2.x-3558
v2.2.0-3546-centos-7-gcc-8
v2.x-3549
v2.x-cluster_large_mysql_users
v2.x-cov_ci_verification
v2.0.14-tb1
v2.0.14-tb1-3494
v2.0.14-tb1-3488
v2.0.14-tb1-3117
v2.0.14-tb1-2762
v2.0.14-2762
v1.4.13-arm
v2.1.1-3296
v2.2.0
v2.0.18
v2.1.1
v2.0.18-3342
v2.0.18-3182
v2.1.1-3184
v2.1.0-revert-da7fdfe14
v2.0.18-revert-da7fdfe14
v1.4.13-70160
v2.0.18-3354
v2.0.18-3350
v2.0.14-3339
1.4.13-70160
v2.0.18-3339
v2.1.1-3317
v2.1.1-3319
v2.0.18-3317
v2.1.2-LBalgo
v2.0.18-1574
v2.1.2-hgman
v2.0.17
v2.1.0
v2.0.17-3288
v2.0.17-3276
v2.0.17-3273
v2.0.16
v2.0.16-3267
v2.0.16-3265
v2.0.16-3262
v2.0.16-3261
v2.1.1-3252
v2.1.1-collation
v2.0.16-3252
v2.0.16-collation
v2.1.0-parser
v2.0.16-3219
v2.0.16-3216
v2.0.16-3201
v2.0.16-2330
revert-3191-v2.0.16-3190
v2.0.16-3204
v2.0.16-3177
v2.0.16-2619
v2.0.16-3190
v2.0.16-3187
v2.1.0-70118
v2.0.16-3133
v2.0.16-3133_ci_verification
v2.0.16-3150
v2.0.16-change_user
v2.0.15
v2.0.15_amd64_fix
v2.0.15_arm64_packages
v1.4.14-ssl
v2.0.15_arm64
v2.1.0-2820
v2.0.15-sslbug
v2.0.15-KillTrx
v2.0.14
v2.0.14-ch_build_fix
v2.0.14-focal
v2.0.14-valgrind20200904
v2.1.0-3042
v2.0.14-3035
v2.0.14-3036
v2.0.14-2955
v2.0.14-vars
v2.0.14-3005
v2.0.14-3003
v2.0.14_2970_2979
v2.0.14-NOTSOCK
v2.1.0'
v2.0.14-2958
v1.4.10-zd
v2.0.13
v2.0.13-autocommit_fix
v2.1.0-2892
v2.0.13-2711
v2.0.13-duplicated_variables
v2.0.13-duplicated_variables_for_2.1.0
v2.0.12-deprecate_eof
v2.1.0-1377
v2.1.0-admin_queries
v2.0.12-var-global-multiplex
v2.1.0-var-foreign-key
v2.0.12
v2.0.12-tab-small-log
v2.0.12-var-foreign-key
v2.0.12-var-long-query-time
v2.0.12-galera-shunned
v2.1.0-admin_queries_2
v2.1.0-tap-rm-config
v2.0.12-tap-rm-config-test
v2.1.0-QP_stmt_3
v2.0.11-fix-multi-2-ci
v2.0.11-fix-multi
v2.0.11-266_0-3
2.1.0
v2.0.11
v2.1.0-track-vars
v2.1.0-track-variables
v2.0.11-track-variables
v2.0.11-2526
v2.0.11-tap-tests
v2.0.13-2698-commit1
v2.0.10-galera-pxc-maint-mode
v2.0.11-track-vars
v2.0.10-2647
v2.0.11-track
v2.0.11-track-session-vars
v2.0.9-var-array-review
v2.0.11-stats
v2.0.10
v2.0.10-centos67
v1.4.14.2
1.4.14.2
v1.4.14-show-warnings
v2.0.9
v2.0.9-var-array_2
v2.0.9-var-array
v1.4.16
v2.0.8
val214-changing_charset
v2.0.6
v1.4.16-1922_2
v1.4.13.2
v2.0.4-charset248
v2.0.5
v1.4.10-67841
v2.0.4
v2.0.4-sqlite327
v2.0.3
v2.0.2
v1.4.15
v2.0.1
v1.4.14
v2.0.0
v1.4.14-ping_shun
v1.4.14-1828
v1.4.14-latency_awareness
v1.4.12
v1.4.13-admin_deadlock
v2.0.0-improve_speed
v1.4.13
v1.4.13-autocommit_revert
v1.4.11.2
v1.4.13-ps
v2.0.0_bionic_deb_fix
v2_962
v1.4.12-1640
v1.4.11-names_tz
v1.4.12-1693
master
v1.4.11
v1.4.10
v1.4.6
v1.3.10
jenkins_test
v2.0.0-cachegrind
v1.4.9
v2.0-lab
v149_1511
v149_1382
v1.4.7-f2
v1.4.7-f1
v149_1491
v1.4.5-kub
v1.4.8
v2.0-web2
v1.4.3
v1.4.7
bsd_install_update
v1.4.2
v1.4.1-ch2
v1.4.1
v1.3.9
v1.4.1-ch
v1.3.8
v1.3.8-dev
v1.3.7
v1.3.7-dev
v1.3.6-dev
v1.4.0-clickhouse
v1.4.0
v1.3.6
v1.3.5
v1.3.5-dev
v1.4.0-955
v1.3.4
v1.3.4-dev
v1.3.3
v1.3.3-dev
v1.3.2
v1.3.2-dev
v1.3.2-766
v1.3.0h
v1.3.1-utf8mb4
1.4.0-840
v1.3.1
v1.2.6
v1.3.0
v1.4.0-797
v1.2.5-715
v1.2.5
v1.2.4-lowmem
v1.3.1-dev-mem
v1.2.0
connleak
lab-1.2.0
v1.1.2
T107_add_proxysql_consul_requirements
T89_write_consul_integration_doc
T98_consul_multi_table_config
mongoose
evhttp
SQLiteServer
1.0
3.0.9
3.0.8
3.0.7
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
2.7.3
2.6.6.1
3.0.1
2.7.2
3.0.0
2.6.6
2.7.1
2.7.0
2.6.5
2.6.4
2.6.3
2.6.2
2.6.1
2.5.5
2.6.0
2.5.4
2.5.3
2.5.2
2.5.1
2.4.8
2.5.0
2.4.7
2.4.6
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.2
2.3.1
2.3.0
2.2.2
2.2.1
2.2.0
2.0.18
2.1.1
2.0.17
2.0.16
2.0.15
2.0.14
2.0.13
2.0.12
2.0.11
2.1.0
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
1.4.16
1.4.15
2.0.1
1.4.14
1.4.13
1.4.12
1.4.11
1.4.10
1.3.10
1.4.9
2.0.0
1.4.8
1.4.7
1.4.6
1.4.4
1.4.3
1.4.2
1.3.9
1.3.8
1.4.1
1.3.7
1.4.0
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0h
1.3.0g
1.3.0f
1.3.0e
1.3.0d
1.3.0c
v1.3.0b
1.4.5
v1.1.0
v1.1.0-rc
v1.1.1-beta
v1.1.1-beta.1
v1.1.1-beta.2
v1.1.1-beta.3
v1.1.1-beta.4
v1.1.1-beta.5
v1.1.1-beta.6
v1.1.2
v1.2.0a
v1.2.0b
v1.2.0c
v1.2.0d
v1.2.0e
v1.2.0f
v1.2.0g
v1.2.0h
v1.2.0i
v1.2.0j
v1.2.0k
v1.2.1
v1.2.2
v1.2.3
v1.2.4
v1.2.4.0923
v1.2.5
v1.2.6
v1.3.0
v1.3.0a
v1.3.0g
v1.3.0h
v1.3.1
v1.3.10
v1.3.2
v1.3.2-1
v1.3.3
v1.3.4
v1.3.5
v1.3.6
v1.3.7
v1.3.8
v1.3.9
v1.3.9-prev.1
v1.4.0
v1.4.1
v1.4.10
v1.4.11
v1.4.12
v1.4.13
v1.4.14
v1.4.15
v1.4.16
v1.4.2
v1.4.3
v1.4.4
v1.4.5
v1.4.6
v1.4.7
v1.4.8
v1.4.9
v2.0.0-beta.1
v2.0.0-rc1
v2.0.0-rc2
v2.0.1
v2.0.10
v2.0.11
v2.0.12
v2.0.13
v2.0.14
v2.0.15
v2.0.16
v2.0.17
v2.0.18
v2.0.2
v2.0.3
v2.0.4
v2.0.5
v2.0.6
v2.0.7
v2.0.8
v2.0.9
v2.1.0
v2.1.1
v2.2.0
v2.2.1
v2.2.2
v2.3.0
v2.3.1
v2.3.2
v2.4.0
v2.4.1
v2.4.2
v2.4.3
v2.4.4
v2.4.5
v2.4.6
v2.4.7
v2.4.8
v2.5.0
v2.5.1
v2.5.2
v2.5.3
v2.5.4
v2.5.5
v2.6.0
v2.6.1
v2.6.2
v2.6.3
v2.6.4
v2.6.5
v2.6.6
v2.7.0
v2.7.1
v2.7.2
v2.7.3
v3.0.0-alpha
v3.0.1
v3.0.2
v3.0.3
v3.0.4
v3.0.5
v3.0.6
v3.0.7
v3.0.8
v3.0.9
v3.1.6
v3.1.7
v3.1.8
v3.1.9
v4.0.6
v4.0.7
v4.0.8
${ noResults }
70 Commits (97eab1bbf0ce3c7c453e8a8bb96b2bd564e4758f)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
a9f2eaaa13 |
feat: remove PROXYSQLGENAI flag, genai now builds under PROXYSQL40 (issue #5722)
PROXYSQLGENAI flag eliminated entirely. PROXYSQL40=1 now unconditionally builds the genai plugin alongside core. All #ifdef PROXYSQLGENAI replaced with #ifdef PROXYSQL40 in source, Makefiles, and 61 CI workflows. |
2 months ago |
|
|
967ab401ec |
genai: fix lifecycle reloads and drop dead MCP stats registration
Load GenAI and MCP variables before runtime initialization, reinitialize the AI stack on reload, and make the anomaly hook obey the configured enable flags. Restore the missing MCP command aliases and the disk/config reload verbs, fix the MySQLX packaging filename mismatch, and update the unit harness for the plugin ABI. Also remove the stale stats_mcp_* registrations from the plugin surface. There is no plugin-side writer for those tables in this branch, so advertising them as live schema was misleading. Update the unit test and bootstrap comments to match the actual exposed surface. |
2 months ago |
|
|
b6b6a4f62b |
fix(genai): properly gate sqlite-vec hook on PROXYSQLGENAI
Reverts |
2 months ago |
|
|
482ce386cd |
chore(genai-carveout): strip dead PROXYSQLGENAI blocks + plugin hardening
Two threads of cleanup that had to land together because they touch
both core (where the dead code lives) and the plugin (where the new
module-owned state lives):
# Strip dead #ifdef PROXYSQLGENAI from lib/, include/, src/ (Spec Q9)
Step 7 of the carve-out left PSQLGA empty in lib/Makefile, so every
#ifdef PROXYSQLGENAI block in the core build became permanently false.
The blocks remained as dead text (visible to readers, irrelevant to
the binary). Strip ~600 lines spanning:
src/main.cpp 2 sites
lib/Admin_Bootstrap.cpp 3 sites (mcpdb open + attach +
flush_*_variables hooks)
lib/Admin_FlushVariables.cpp 2 sites (~250 lines of stub +
#if 0 _ORIGINAL bodies)
lib/Admin_Handler.cpp 5 sites (LOAD/SAVE GENAI VARIABLES
dispatch + LOAD/SAVE MCP
VARIABLES dispatch +
MCP profiles handler)
lib/ProxySQL_Admin.cpp ~10 sites (init_*_variables +
load_mcp_server +
load/save_mcp_query_rules
+ GenericRefreshStatistics
MCP probes)
lib/ProxySQL_Admin_Stats.cpp 3 stats___mcp_* function bodies
include/proxysql_admin.h 7 method declarations
include/ProxySQL_Admin_Tables_Definitions.h 4 unused DDL macros
The plugin now owns LOAD/SAVE MCP VARIABLES, LOAD/SAVE GENAI VARIABLES,
LOAD/SAVE MCP PROFILES, LOAD/SAVE MCP QUERY RULES via its admin command
registry; the chassis dispatcher catches them before any of the dead
core branches would have fired.
Caveat — known break: the `stats_mcp_*` tables are still registered
(empty schema) but the populator path that fed them is gone. SELECTs
return empty result sets until a follow-up wires the populator into
the plugin (likely via register_runtime_view or a parallel stats-side
ABI). Tracked separately.
# Plugin hardening (review-feedback items 4-7)
* plugins/genai/Makefile: add -fvisibility=hidden,
-fvisibility-inlines-hidden, -fstack-protector-strong (mirrors
plugins/mysqlx). Tag proxysql_plugin_descriptor_v1 with
__attribute__((visibility("default"))) so the loader's dlsym still
resolves; without the explicit annotation the hidden-default flag
would also hide the entry point.
* plugins/genai/src/Anomaly_Detector.cpp: convert
genai_anomaly_embed_fn to std::atomic<…> with relaxed loads/stores.
The detector hot-path read races with init/stop on the lifecycle
thread; atomics give us a portable no-torn-pointer guarantee
without paying for acquire/release fences we don't need (no other
state synchronises with the pointer). Replaces the hand-wavy
"no mutex needed" comment with the actual reasoning.
* plugins/genai/src/{plugin_main,plugin_commands,plugin_tables}.cpp:
route the 17 fprintf(stderr, "genai plugin: ...") log lines
through a new genai_log() helper that calls
services->log_message when the chassis is wired up and falls back
to stderr for early-init / unit-test paths. Lines now land in
proxysql.log alongside the rest of the runtime.
* plugins/genai/include/MCP_Thread.h: add get_variable_string(name,
std::string&) returning a std::string, and switch
mcp_save_variables_to_admindb (plugin_main.cpp) to it. The legacy
get_variable(name, char*) had an unbounded sprintf into a stack
buffer and the SAVE path was passing char val[256] — a real
overflow risk for *_endpoint_auth bearer tokens.
* plugins/genai/src/plugin_main.cpp: rewrite the genai_init / genai_stop
comment block with the actual teardown ordering rationale (consumers
before producers; atomic-clear-then-delete for the embed hook;
why Prometheus counters stay registered).
|
2 months ago |
|
|
28cf4ceab8 |
feat(plugins/genai): Step 5 — move GenAI/LLM/AI surface into the plugin
Largest carve-out commit since 4.C: moves the GenAI / LLM / AI / RAG
surface (about 7K LOC) out of core into plugins/genai/. After this
commit, libproxysql.a no longer publishes any of GenAI_Threads_Handler,
LLM_Bridge, LLM_Clients, AI_Features_Manager, AI_Tool_Handler,
RAG_Tool_Handler, or the legacy GloGATH/GloAI globals.
Files moved (git mv preserves history)
Headers (include/ -> plugins/genai/include/)
GenAI_Thread.h
LLM_Bridge.h
AI_Features_Manager.h
AI_Tool_Handler.h
RAG_Tool_Handler.h (promoted from Step 6 — bidirectional
dep with AI_Features_Manager forced
the early move, same way MySQL_FTS.h
got promoted in 4.C)
Sources (lib/ -> plugins/genai/src/ or …/tool_handlers/)
GenAI_Thread.cpp
LLM_Bridge.cpp
LLM_Clients.cpp (.cpp without a header; class decls
live in LLM_Bridge.h)
AI_Features_Manager.cpp
AI_Tool_Handler.cpp -> tool_handlers/
RAG_Tool_Handler.cpp -> tool_handlers/
Plugin lifecycle takeover
plugins/genai/src/plugin_main.cpp:
- Defines plugin-local GloGATH and GloAI alongside the existing
GloMCPH (all three are .so-internal aliases for the contexts
genai_init constructs).
- genai_init now also constructs GenAI_Threads_Handler (calls
->init()) and AI_Features_Manager (calls ->init()), mirroring
the pre-Step-5 ProxySQL_Main_init_GenAI_module sequence.
- genai_stop tears them down in reverse order.
plugins/genai/src/ProxySQL_MCP_Server.cpp:
- AI / RAG endpoint registration re-enabled (was #if 0'd in 4.C
because the constructors weren't reachable from the plugin
then). /mcp/ai and /mcp/rag are once again live when the
operator has GloAI configured.
plugins/genai/src/Anomaly_Detector.cpp + plugin_main.cpp:
- get_query_embedding() now calls through a function-pointer
hook (genai_anomaly_embed_fn) that plugin_main installs in
genai_init and clears in genai_stop. This indirection lets
the test fixture (which compiles Anomaly_Detector.cpp directly
into a test binary, without GenAI_Thread.cpp) link cleanly —
the pointer stays null, the detector short-circuits to empty
embedding, and the existing nullptr-guard in
check_embedding_similarity does the rest.
Core neutralization
src/main.cpp:
- Drops the GloGATH / GloAI globals, ProxySQL_Main_init_GenAI_module
definition + call, the shutdown branch, and the
`if (GloGATH) init_genai_variables()` call.
lib/Admin_Bootstrap.cpp / Admin_FlushVariables.cpp / Admin_Handler.cpp /
ProxySQL_Admin.cpp / MySQL_Session.cpp / ProxySQL_Admin_Stats.cpp:
- Drop the corresponding `#include` and `extern` declarations.
- flush_genai_variables___* stubbed (mirrors the 4.C MCP pattern;
original bodies preserved in `#if 0` for the upcoming
LOAD/SAVE GENAI verbs port).
lib/Admin_Handler.cpp:
- Loose-prefix accept for `genai-*` in is_valid_global_variable
(mirrors the 4.F mcp-* fix), so SET genai-X=Y still reaches
main.global_variables; runtime push happens via the plugin's
LOAD GENAI VARIABLES TO RUNTIME (registered in a follow-up).
include/cpp.h, include/proxysql.h:
- Removed the AI_Features_Manager.h / LLM_Bridge.h / GenAI_Thread.h
/ AI_Tool_Handler.h / RAG_Tool_Handler.h includes that no
longer resolve from core's -I path.
test/tap/test_helpers/test_globals.cpp:
- Drops the matching `#include`s and stub globals.
Test fixture
test/tap/tests/unit/Makefile:
- PROXYSQLGENAI auto-detect probe switched from `GenAI_Thread`
(now plugin-only) to `AI_Vector_Storage` (still in core for
Step 6). After Step 6 the probe will switch again, and
Step 7 deletes the auto-detect entirely.
All three plugin unit tests pass:
- genai_plugin_load_unit-t : 25/25
- genai_plugin_anomaly_unit-t : 6/6
- genai_plugin_backend_client : 27/27
Carve-out scoreboard:
Step 0-2 : infrastructure
Step 3 : ~1.1 K LOC (Anomaly_Detector)
Step 4.B : ~0.5 K LOC (backend_client)
Step 4.C : ~13 K LOC (MCP subsystem)
Step 4.F : runtime-reconfig admin SQL routed through plugin commands
Step 4.G : MCP admin / config / stats tables registered via plugin ABI
Step 5 : ~7 K LOC (GenAI/LLM/AI/RAG)
Pending: Step 6 (AI_Vector_Storage, MySQL_Catalog, Discovery_Schema,
Static_Harvester, PgSQL_Static_Harvester) and Step 7 (delete the
PROXYSQLGENAI macro entirely).
|
2 months ago |
|
|
9078fd3150 |
feat(plugins/genai): Step 4.G — register MCP admin tables via plugin ABI
Moves MCP admin / config / stats SQLite table registration from
lib/Admin_Bootstrap.cpp into the plugin via the chassis
register_table service. Pure refactor: the same DDL strings produce
the same SQLite tables in the same SQLite DBs; only the registration
path changes.
New plugins/genai/src/plugin_tables.cpp registers 14 tables:
admin DB (6)
mcp_query_rules, runtime_mcp_query_rules
mcp_auth_profiles, runtime_mcp_auth_profiles
mcp_target_profiles, runtime_mcp_target_profiles
config DB (3)
mcp_query_rules, mcp_auth_profiles, mcp_target_profiles
(no runtime_* in config; matches the pre-4.G layout)
stats DB (5)
stats_mcp_query_tools_counters, _reset
stats_mcp_query_digest, _reset
stats_mcp_query_rules
The DDL strings still live in include/ProxySQL_Admin_Tables_Definitions.h
for now — plugin_tables.cpp #includes the header. Migrating the
macros into a plugin-private header is a follow-up gated on no
remaining core caller of the MCP table macros (Step 7 territory).
Core changes (lib/Admin_Bootstrap.cpp):
- Deleted the 9 admin/config insert_into_tables_defs() entries
inside `#ifdef PROXYSQLGENAI` for mcp_*.
- Deleted the 5 stats insert_into_tables_defs() entries similarly.
- Replaced both blocks with a one-line comment pointing at the new
plugin owner.
Plugin lifecycle:
- genai_init() now calls genai_register_admin_tables() right after
genai_register_admin_commands(). Both run during chassis Phase C
(init), before admin module bootstrap so the chassis dispatcher
merges plugin tables into the admin DB schema before any DML.
Test extension (test/tap/tests/unit/genai_plugin_load_unit-t.cpp):
- Updated the "skeleton registers no tables (yet)" assertions to
expect 6 admin / 3 config / 5 stats — matching plugin_tables.cpp.
- 25/25 tests passing.
What this changes for operators (no-op):
- Same SQL: SHOW TABLES still shows mcp_*, runtime_mcp_*, stats_mcp_*.
- Same DDL: column lists, primary keys, defaults — all preserved.
- Same admindb / configdb / statsdb attachment.
|
2 months ago |
|
|
5fe286e972 |
feat(plugins/genai): Step 4.C — move MCP subsystem into the plugin
Per docs/superpowers/plans/2026-04-19-step4-mcp-subsystem-move.md
"4.C / 4.D / 4.E merge" revision. This is the largest single carve-out
commit so far: ~13 K LOC physically relocated, plus surgical edits
across the core admin SQL surface to neutralize references to the
moved code.
What moved (git mv preserves history)
Tool handlers (lib/<name>.cpp -> plugins/genai/src/tool_handlers/<name>.cpp;
include/<name>.h -> plugins/genai/include/<name>.h)
Admin_Tool_Handler, Cache_Tool_Handler, Config_Tool_Handler,
MySQL_Tool_Handler, Observe_Tool_Handler, Query_Tool_Handler,
Stats_Tool_Handler.
MCP listener stack (lib/<name>.cpp -> plugins/genai/src/<name>.cpp;
include/<name>.h(pp) -> plugins/genai/include/...)
MCP_Endpoint, MCP_Thread, ProxySQL_MCP_Server.
Promoted from Step 6 (bidirectional dep with MySQL_Tool_Handler):
MySQL_FTS.
MCP_Tool_Handler base stays in core because AI_Tool_Handler and
RAG_Tool_Handler (Steps 5/6 scope) inherit from it; moving the base
would force pulling those in too.
Plugin lifecycle takeover
plugins/genai/include/genai_plugin.h: GenAIPluginContext now holds
the MCP_Threads_Handler*.
plugins/genai/src/plugin_main.cpp: genai_init constructs the
MCP_Threads_Handler and assigns to a plugin-local GloMCPH symbol
(the legacy global name, kept for the moved tool handlers that
still reference it; the symbol no longer exists in core).
genai_stop tears down on shutdown. genai_start is a no-op for now;
the MCP listener auto-start is gated on the admin-SQL surface that
4.F restores.
plugins/genai/src/ProxySQL_MCP_Server.cpp: AI_Tool_Handler and
RAG_Tool_Handler endpoint registration is disabled via stub
assignments (the headers stay included so member-pointer types
resolve). Steps 5/6 re-enable when those classes move into the
plugin.
Core neutralization (FIXME stubs awaiting 4.F/4.G)
src/main.cpp: GloMCPH global removed; ProxySQL_Main_init_MCP_module
removed; shutdown block deleted.
lib/ProxySQL_Admin.cpp: init_mcp_variables, load_mcp_server,
load_mcp_query_rules_to_runtime, save_mcp_query_rules_from_runtime
stubbed to no-ops; original bodies preserved inside `#if 0` for
4.F reference.
lib/Admin_FlushVariables.cpp: flush_mcp_variables___database_to_runtime
and flush_mcp_variables___runtime_to_database stubbed similarly.
lib/ProxySQL_Admin_Stats.cpp: stats___mcp_query_tools_counters,
stats___mcp_query_digest, stats___mcp_query_rules stubbed.
lib/Admin_Handler.cpp: has_variable("mcp-…") and the
load_target_auth_map call site in LOAD MCP PROFILES … stubbed.
Result: the MCP listener does NOT start automatically between this
commit and 4.F (mcp-* admin variables are not pushed into the
running plugin). Documented in the plan's "4.C/4.D/4.E merge"
section.
src link change: --whole-archive on libproxysql.a
src/Makefile: the proxysql binary now links libproxysql.a with
-Wl,--whole-archive so all symbols are exported via
-Wl,--export-dynamic, allowing the genai plugin .so to dlopen
cleanly even when core code paths don't reference moved-but-still-
in-core classes (LLM_Bridge, Discovery_Schema, MySQL_Catalog,
Static_Harvester, …) directly. test/tap/tests/unit/Makefile gets
the same change so unit tests can dlopen the plugin. Without this,
ld dead-code-eliminates the unreferenced symbols and dlopen fails
with "undefined symbol".
Tests passing
- genai_plugin_anomaly_unit-t : 6/6
- genai_plugin_load_unit-t : 8/8 (lifecycle init/start/stop +
admin table registration)
- genai_plugin_backend_client_unit-t : 27/27
Carve-out scoreboard
Step 0-2 : 0 (infrastructure only)
Step 3 : ~1.1 K (Anomaly_Detector)
Step 4.B : ~0.5 K (backend_client helper, no callers yet)
Step 4.C : ~13 K (this commit; MCP subsystem)
Pending : Steps 4.F, 4.G, 5, 6, 7
|
2 months ago |
|
|
04bccec51e |
chore(plugin-chassis): tighten gating, drop dead paths, gate forgery setters
Five clean-up items from the independent review of PR #5651. None of these change behaviour on a normal run; they each fix a concrete way the current code is misleading or unnecessarily exposed. 1) lib/ProxySQL_Admin.cpp: gate the three plugin-DB-handle getters (proxysql_plugin_get_admindb / _configdb / _statsdb) under #ifdef PROXYSQL40. Previously these were defined unconditionally and emitted symbols into v3.0/v3.1 binaries. The chassis is a v4.0 feature; the user explicitly required that v3.x builds carry no plugin-aware code. Wrap in PROXYSQL40 so they are entirely absent from v3.x linkage. ProxySQL_PluginManager.cpp's extern declarations (lines 23-25) are already inside the file-wide PROXYSQL40 gate and so resolve only when the gate is active. 2) lib/ProxySQL_PluginManager.cpp + include/ProxySQL_PluginManager.h: delete the dead `#else /* !PROXYSQL40 */` branches. Both files are wrapped in a top-level `#ifdef PROXYSQL40` covering the entire body. Inner `#ifdef PROXYSQL40 ... #else ... #endif` blocks therefore had unreachable `#else` arms — 30+ lines of "pre-chassis two-phase loader" in the .cpp, plus a redundant declaration of proxysql_load_configured_plugins in the .h. The dead arms read as load-bearing alternative implementations on review and that is exactly the wrong signal. Drop them; the single PROXYSQL40 path is the only one. 3) lib/Admin_Bootstrap.cpp + include/proxysql_admin.h + src/main.cpp: remove ProxySQL_Admin::materialize_plugin_tables(). `Admin::init()` already merges plugin-declared schemas into tables_defs_{admin,config,stats} (~line 944) and runs the DDL via check_and_build_standard_tables() (~line 994), all on the same first-boot/reload code path the core tables use. The follow-up call to GloAdmin->materialize_plugin_tables() in main.cpp ran a second name-dedup pass that found everything already present and produced an empty new-rows set — i.e. the post-init helper was a no-op disguised as load-bearing infrastructure. Delete the helper, the header declaration, and the main.cpp call site, and update the comments in main.cpp + ProxySQL_PluginManager.cpp to point at Admin::init() as the single canonical materialization site. Leave a NOTE in Admin_Bootstrap.cpp at the old call site so anyone re-adding a similar helper sees why the prior one was removed. 4) plugins/mysqlx/include/mysqlx_session.h + plugins/mysqlx/src/mysqlx_session.cpp: gate the two genuine forgery vectors behind MYSQLX_TEST_BUILD. inject_identity_for_test() bypasses the full auth flow — no credential check, no capability negotiation, just sets identity_ to a caller-supplied MysqlxResolvedIdentity. resolve_backend_target_ for_test() drives a private routing helper without an authenticated identity. Both are necessary for unit tests but should not be reachable at all in shipped binaries; an in-process exploit reaching the session can call inject_identity_for_test() to forge an authenticated identity. Wrap them in #ifdef MYSQLX_TEST_BUILD; define -DMYSQLX_TEST_BUILD in the test Makefile only. The remaining target_*_for_test() getters are read-only state observers and are left unconditional — they cannot mutate the session and a debugger could observe the same state regardless. 5) test/tap/tests/unit/Makefile: define -DMYSQLX_TEST_BUILD on every unit test compile line via OPT. This is the test-only knob that re-enables the gated forgery methods so unit tests still compile. plugins/mysqlx/Makefile does NOT define this macro, so the production .so does not compile in the entry points. Verified locally: - plugins/mysqlx/ProxySQL_MySQLX_Plugin.so builds clean with PROXYSQL40=1 PROXYSQL31=1 PROXYSQLFFTO=1 PROXYSQLTSDB=1 PROXYSQLGENAI=1 (no MYSQLX_TEST_BUILD). - test/tap/tests/unit/mysqlx_robustness_unit-t builds and runs: 74/74 assertions pass, including the ones that exercise inject_identity_for_test (visible only because the test Makefile defines MYSQLX_TEST_BUILD). |
2 months ago |
|
|
e462bb0cb4 |
fix: address PR review feedback
Resolves in-scope review items on PR #5651. Items deemed out of scope for this PR (O(N) admin dispatch lookup, per-plugin mutex, worker backpressure, runtime-reload DDL semantics, E2E tests going through ProxySQL rather than directly to MySQL) are tracked elsewhere; items that were already fixed in earlier commits on this branch (Admin_Handler MYSQLX alias vectors, Admin_Bootstrap PROXYSQL40 gating) are acknowledged as stale. Changes: * .github/workflows/CI-mysqlx.yml: add `include/` and `src/proxysql_global.cpp` to both `sparse-checkout` blocks. The plugin Makefile discovers the repo root via `src/proxysql_global.cpp` and includes headers from `include/`; without these, `make` inside `plugins/mysqlx` climbs up to `/` or fails on missing includes. (coderabbit: "Checkout the files required by the plugin Makefile.") * .github/workflows/CI-mysqlx.yml: `fail-on-cache-miss` now depends on `github.event_name == 'workflow_run'`. Strict behavior is retained for the cache-driven pipeline that CI-trigger populates; manual `workflow_dispatch` runs no longer fail when the SHA-specific cache doesn't exist yet. (coderabbit: "Don't make manual runs depend on a pre-existing build cache.") * plugins/mysqlx/Makefile: replace the unbounded `while [ ! -f ./src/proxysql_global.cpp ]; do cd ..; done` with a bounded upward walk (up to 12 levels) that fails fast with a clear error message when the marker file is missing — e.g. on a sparse checkout that omits `src/proxysql_global.cpp`. Build output no longer appears to hang indefinitely. (coderabbit: "Prevent root discovery from hanging on sparse or invalid checkouts.") * doc/PLUGIN_API.md: update startup sequence from the old three-phase (load → init → start) description to the four-phase chassis lifecycle (load → register_schemas → admin materialize → init → start). Document the `register_schemas` descriptor field and the `abi_version` / `PROXYSQL_PLUGIN_ABI_VERSION` contract. Clarify that `stop()` pairs with `init()` (not `start()`) for teardown symmetry. (coderabbit: "Update plugin lifecycle documentation to reflect four-phase model and ABI versioning.") * plugins/mysqlx/include/mysqlx_session.h: default-initialize every field in `MysqlxCredentials`. `bool x_enabled` was indeterminate for a default-constructed instance, which would let a lookup miss produce a value that silently authenticates. In-class initializers give every field a deterministic default. (coderabbit: "Default- initialize credential fields used by auth decisions.") * plugins/mysqlx/src/mysqlx_backend_session.cpp: close `backend_fd_` when `authenticate_backend()` returns false. Previously `connect()` stored the newly-opened fd in `backend_fd_` and returned the auth result; a retry on the same `MysqlxBackendSession` would then overwrite `backend_fd_` and leak the previous socket. (coderabbit: "Close/reset `backend_fd_` when authentication fails.") * lib/Admin_Bootstrap.cpp: `materialize_plugin_tables()` now runs DDL only for the subset of plugin-declared tables that were freshly inserted into `tables_defs_*` (the rest are already materialized). DDL failures are startup-fatal: on `execute()` returning false, log the plugin kind + table name + SQL and `exit(EXIT_FAILURE)`. A partially materialized schema produces opaque runtime errors from the plugin later on, so aborting startup is the right default. (gemini + coderabbit: "Execute DDL only for newly materialized plugin tables" / "add error checking".) Not changed in this commit (deferred / out of scope / stale): * CI-mysqlx E2E tests going through ProxySQL (requires plumbing listener + admin config in the CI workflow). * O(N) admin dispatch scan → hash map. * Descriptor build-id hash for libstdc++ compat detection. * Per-plugin mutex on mutable plugin context. * Worker client-fd enqueue backpressure. * Stale plan-doc feedback on docs/superpowers/plans/*.md. Verification (clean tree): * `unset PROXYSQL*; make cleanall && make debug -j$(nproc) && make build_tap_test_debug -j$(nproc)` -- 0 errors. * `PROXYSQLGENAI=1 make cleanall && PROXYSQLGENAI=1 make debug -j$(nproc) && PROXYSQLGENAI=1 make build_tap_test_debug -j$(nproc)` -- 0 errors. * Plugin unit tests (PROXYSQL40): 48 + 52 + 26 + 46 + 10 = 182 pass. |
2 months ago |
|
|
3ba92815f8 |
fix(plugin-chassis): make chassis fully invisible in v3.x builds
Review feedback identified that the chassis was leaking into the v3.0
stable build via unfenced references in core code:
* Admin_Bootstrap.cpp had `if (auto* m = proxysql_get_plugin_manager())`
and a full materialize_plugin_tables() implementation outside any
PROXYSQL40 fence
* proxysql_admin.h declared materialize_plugin_tables()
* proxysql_glovars.hpp held GloVars.plugin_modules and
proxysql_load_plugin_modules_from_config()
* ProxySQL_GloVars.cpp had three unfenced .clear()/use sites
* ProxySQL_Admin.cpp::dispatch_plugin_admin_command (template + two
instantiations) was unfenced
* src/main.cpp's GloPluginManager, LoadConfiguredPlugins,
InitConfiguredPlugins, StartConfiguredPlugins, StopConfiguredPlugins,
UnloadPlugins teardown, the four-phase orchestration block, and the
proxysql_load_plugin_modules_from_config call were all unfenced
Separately, Admin_Handler.cpp held 16 hardcoded MYSQLX alias vectors
(LOAD_MYSQLX_USERS_FROM_MEMORY, etc.) and a 16-deep if-ladder that
called resolve_admin_alias_to_canonical(). This embedded plugin-specific
knowledge in core code -- core should know nothing about any specific
plugin's commands.
The agreed architecture: v3.0/v3.1 builds have NO plugin loader at all;
the entire plugin chassis (including its public manager surface, its
loader, and its dispatch helpers) only exists under PROXYSQL40. v3.0
core code therefore holds zero plugin-related code paths.
Changes:
* include/ProxySQL_Plugin.h, include/ProxySQL_PluginManager.h,
lib/ProxySQL_PluginManager.cpp: wrap entire file body in
`#ifdef PROXYSQL40 ... #endif`. Including the header from a v3.x
translation unit yields nothing; the .cpp compiles to an empty object
file. Removed redundant inner PROXYSQL40 fences inside the now-empty
v3.x body of Plugin.h (kept the few that are inside the file-wide
outer for clarity). PROXYSQL_PLUGIN_ABI_VERSION is now unconditionally
2 (the macro is no longer reachable from a v3.x compile, so the
PROXYSQL40-vs-1 split is moot).
* include/proxysql_glovars.hpp, lib/ProxySQL_GloVars.cpp: gate
GloVars.plugin_modules field, all .clear() sites, the
proxysql_load_plugin_modules_from_config declaration + definition.
* include/proxysql_admin.h: gate materialize_plugin_tables and
dispatch_plugin_admin_command<S> declarations.
* lib/Admin_Bootstrap.cpp: gate `#include "ProxySQL_PluginManager.h"`,
the `if (auto* m = proxysql_get_plugin_manager())` merge block, and
the materialize_plugin_tables definition.
* lib/Admin_Handler.cpp: delete the 16 LOAD_/SAVE_MYSQLX_* const
std::vector<std::string> declarations entirely. Delete the helper
resolve_admin_alias_to_canonical(). Delete the 16-deep if-ladder
+ the !PROXYSQL40 fallback dispatch branch. The remaining plugin
dispatch is one generic call to
proxysql_resolve_configured_plugin_admin_alias() inside an
#ifdef PROXYSQL40 block; v3.x compiles it out entirely. Core now
holds no plugin-specific knowledge of any kind.
* lib/ProxySQL_Admin.cpp: gate dispatch_plugin_admin_command template
body + both explicit instantiations.
* src/main.cpp: gate `#include "ProxySQL_PluginManager.h"`,
GloPluginManager declaration, all four wrapper functions
(LoadConfiguredPlugins / InitConfiguredPlugins /
StartConfiguredPlugins / StopConfiguredPlugins), the
StopConfiguredPlugins call inside UnloadPlugins, the four-phase
orchestration in ProxySQL_Main_init_phase2___not_started, the
GloVars.plugin_modules.clear() and the
proxysql_load_plugin_modules_from_config call in
ProxySQL_Main_process_global_variables. v3.x builds reduce that
whole block to a single ProxySQL_Main_init_Admin_module call.
* plugins/mysqlx/src/mysqlx_plugin.cpp,
plugins/mysqlx/src/mysqlx_admin_schema.cpp: drop the !PROXYSQL40
fallback paths. The plugin only loads under PROXYSQL40 now (no
loader exists in v3.x), so the legacy combined-init code path and
the 16 fallback register_command() calls were dead code. The
descriptor unconditionally wires register_schemas; mysqlx_init holds
only context setup.
* Makefile (top-level): the four build_src_* recipes that recurse into
plugins/mysqlx are wrapped in `$(if $(filter 1,$(PROXYSQL40)),...)`.
v3.x builds emit "[skip] mysqlx plugin (PROXYSQL40 not set)" instead
of building the .so. Clean targets stay unconditional.
* test/tap/tests/unit/mysqlx_admin_alias_resolution_unit-t.cpp:
delete the test (it covered resolve_admin_alias_to_canonical, which
is itself deleted). Remove from unit Makefile UNIT_TESTS list.
Verification:
* v3.0 stable build (`make`, no flags):
- Produces 147 MB src/proxysql binary
- `nm src/proxysql | grep -cE 'invoke_register_schemas_phase|GloPluginManager|materialize_plugin_tables'` -> 0
- mysqlx plugin .so is correctly skipped: "[skip] mysqlx plugin (PROXYSQL40 not set)"
* PROXYSQLGENAI=1 build (cascades PROXYSQL40/31/FFTO/TSDB):
- Produces 200 MB src/proxysql binary with chassis symbols
- mysqlx plugin .so built (9.2 MB), contains mysqlx_register_schemas
* All 5 plugin unit tests pass under PROXYSQL40:
plugin_config_unit-t 48/48
plugin_dispatch_unit-t 52/52
plugin_lifecycle_unit-t 26/26
plugin_query_hook_unit-t 46/46
plugin_prometheus_unit-t 10/10
|
2 months ago |
|
|
ab9d5a1036 |
fix(plugin-chassis): address deep-review findings
Follow-up to
|
2 months ago |
|
|
5c1549dcc6 |
merge: resolve conflicts with v3.0 branch
Merge origin/v3.0 into ProtocolX. One conflict in test/tap/tests/unit/Makefile resolved by keeping both mysqlx unit tests (ProtocolX) and pgsql_servers_ssl_params unit test + GENAI vec.o link (v3.0). |
2 months ago |
|
|
c764d66e2c |
fix(mysqlx): preserve plugin table data across ProxySQL restarts
Two critical fixes for MYSQLX plugin config persistence: 1. materialize_plugin_tables() no longer calls check_and_build_standard_tables() for plugin tables. The previous implementation added plugin tables to the standard table defs vector, then check_and_build_standard_tables() would DROP TABLE IF EXISTS + CREATE TABLE for each — destroying persisted data in the config DB on every restart. Now plugin tables are created with a plain execute(table_def) which uses CREATE TABLE (fails harmlessly if the table already exists, preserving its data). 2. sync_disk_to_memory() and copy_to_runtime() in mysqlx_start() automatically restore MYSQLX config from the persisted config DB: - sync_disk_to_memory: copies disk.mysqlx_* → main.mysqlx_* (admin DB) - copy_to_runtime: copies main.mysqlx_* → main.runtime_mysqlx_* This means routes, users, backend endpoints, and variables configured via SAVE MYSQLX * TO DISK are automatically available at startup, allowing the X Protocol listener to bind the configured ports immediately. Verified: ProxySQL starts with port 33060 listening when MYSQLX routes were previously saved to disk. |
2 months ago |
|
|
886f09c211 |
chore(sqlite): remove dead-code sqlite-rembed hook pointer
proxy_sqlite3_rembed_init was declared unconditionally as NULL
with a TODO comment ("Fix sqlite-rembed header inclusion and assign
the function pointer properly") and never reassigned anywhere in
the tree. The sole caller in Admin_Bootstrap::__bootstrap was
null-guarded, so the sqlite-rembed auto-extension was never
registered at runtime in any build tier, stable or GENAI.
This commit removes the pointer, its extern declaration, and the
null-guarded call. No runtime behavior changes; subsequent commits
remove the build-system wiring and the Rust toolchain dependency
that existed solely to produce libsqlite_rembed.a.
|
2 months ago |
|
|
82fd3afb34 |
feat(mysqlx): wire admin interface for MYSQLX LOAD/SAVE commands
The MYSQLX plugin admin commands (LOAD/SAVE MYSQLX USERS/ROUTES/ BACKEND_ENDPOINTS/VARIABLES TO RUNTIME/FROM MEMORY) were returning 'syntax error' because the MYSQLX dispatch block in Admin_Handler.cpp was placed AFTER the generic LOAD/SAVE catch-all at line 3883. This meant all LOAD/SAVE commands were intercepted by admin_handler_command_load_or_save() which knows nothing about MYSQLX. Changes: - Move MYSQLX dispatch block before the generic LOAD/SAVE handler so MYSQLX commands are checked first (Admin_Handler.cpp lines ~3883-3900) - Add LOAD_MYSQLX_VARIABLES_FROM_MEMORY and SAVE_MYSQLX_VARIABLES_TO_MEMORY alias vectors for MYSQLX VARIABLES commands - Add ProxySQL_Admin::materialize_plugin_tables() in Admin_Bootstrap.cpp that merges plugin table definitions into admin/config/stats table lists and creates the tables in SQLite - Call materialize_plugin_tables() in main.cpp after LoadConfiguredPlugins() but before StartConfiguredPlugins() so plugin tables exist before the plugin starts - Declare materialize_plugin_tables() in proxysql_admin.h This ensures that when a user issues e.g. 'LOAD MYSQLX USERS TO RUNTIME', the command reaches dispatch_plugin_admin_command() which forwards it to the MYSQLX plugin's registered admin command handlers. |
2 months ago |
|
|
5dd717a8f1 |
fix: fail fast on plugin table conflicts
|
2 months ago |
|
|
2430516600 |
fix: reject conflicting plugin registrations
|
2 months ago |
|
|
cd15afdd1e |
feat: support plugin-owned admin tables and commands
|
2 months ago |
|
|
5ad511568a |
feat: add pgsql_servers_ssl_params table definitions and admin bootstrap
|
2 months ago |
|
|
efedd93c92 |
Rename stats_global to stats_proxysql_global to avoid strstr substring collision
stats_global is a substring of stats_mysql_global and stats_pgsql_global, causing the strstr-based dispatch to match incorrectly. Exclusion guards don't work either because a query referencing both tables would suppress the stats_proxysql_global refresh. Renaming to stats_proxysql_global follows the existing naming convention (stats_mysql_global, stats_pgsql_global) and eliminates the substring collision entirely. |
3 months ago |
|
|
e274862857 |
feat: introduce stats_global table and move TLS metrics out of stats_mysql_global; add TAP tests
- Add STATS_SQLITE_TABLE_GLOBAL definition (stats_global table for non-MySQL/PgSQL metrics) - Register stats_global in Admin_Bootstrap.cpp - Add stats___global() implementation and declaration; document with Doxygen comment - Remove TLS_* variables from stats___mysql_global() - they were misplaced there - Move all TLS tracking metrics to stats___global() under ssl_mutex - Wire up stats_global query detection and refresh in GenericRefreshStatistics() - Add TAP test test_tls_stats-t.cpp: - Verifies stats_global contains all 6 TLS tracking variables - Checks value ranges and validity of each TLS variable - Verifies stats_tls_certificates has 2 rows (server + ca) with correct fields - Verifies TLS_Load_Count increments and TLS_Last_Load_Timestamp increases after PROXYSQL RELOAD TLS - Confirms TLS variables are absent from stats_mysql_global Co-authored-by: renecannao <3645227+renecannao@users.noreply.github.com> |
3 months ago |
|
|
4f88740b20 |
feat: add stats_tls_certificates table and TLS tracking metrics
- Add STATS_SQLITE_TABLE_TLS_CERTIFICATES definition with cert_type, file_path, subject_cn, issuer_cn, serial_number, not_before, not_after, days_until_expiry, sha256_fingerprint, and loaded_at columns - Add TLS tracking fields to GloVars.global: tls_load_count, tls_last_load_timestamp, tls_last_load_ok, tls_cert_file, tls_ca_file, tls_key_file - Update ProxySQL_create_or_load_TLS() to populate tracking fields on success - Register stats_tls_certificates table in Admin_Bootstrap - Add stats___tls_certificates() function that reads certs from disk at query time, extracts metadata (CN, serial, validity dates, SHA-256 fingerprint, days_until_expiry) and populates the table - Add TLS variables to stats___mysql_global(): TLS_Load_Count, TLS_Last_Load_Timestamp, TLS_Last_Load_Result, TLS_Server_Cert_File, TLS_CA_Cert_File, TLS_Key_File - Wire up query detection and refresh in GenericRefreshStatistics() Co-authored-by: renecannao <3645227+renecannao@users.noreply.github.com> |
3 months ago |
|
|
4d58ce473e
|
Merge pull request #5435 from sysown/v3.0-ci_fix0301
Fix tests for isolated CI environment and enhance diagnostics |
3 months ago |
|
|
c2f678a9de |
feat: implement release tiers and feature guards for v3.0, v3.1, and v4.0
This commit introduces a structured release tier system controlled by
environment variables, allowing three distinct ProxySQL versions to be
built from the same codebase while maintaining a clear upgrade path.
Key Changes:
- Tier 1 (v3.0.x Stable): Default build including bug fixes and core enhancements.
- Tier 2 (v3.1.x Innovative): Enabled via PROXYSQL31=1. Adds FFTO and TSDB.
- Tier 3 (v4.0.x AI/MCP): Enabled via PROXYSQLGENAI=1. Adds the AI stack.
Implementation Details:
- Makefile: Implemented dynamic versioning logic that increments the minor
version for v3.1 and the major version for v4.0. Added tier documentation.
- Feature Guards: Introduced PROXYSQLFFTO and PROXYSQLTSDB guards across
ProxySQL_Admin, ProxySQL_Statistics, REST API, and HTTP server.
- FFTO: Guarded Fast Forward Traffic Observer in MySQL and PgSQL sessions,
including thread-local variables and configuration parameters.
- TSDB: Guarded the entire Time Series Database subsystem, including SQLite
table definitions, background loops, and REST API endpoints.
- Build Fixes:
* Fixed 'proxy_debug_func' linkage by adding extern "C" and moving the
definition outside of DEBUG guards to ensure non-debug builds link correctly.
* Corrected misplaced/nested DEBUG and PROXYSQLFFTO guards.
* Verified build stability for all tiers (unset, PROXYSQL31=1, PROXYSQLGENAI=1).
|
3 months ago |
|
|
cf1fd5cb35 |
Admin: Add support for loading sqliteserver variables from config file
Previously, sqliteserver variables (e.g., sqliteserver-mysql_ifaces) were not loaded from the configuration file during startup or via the LOAD SQLITESERVER VARIABLES FROM CONFIG command. This fix adds: - LOAD SQLITESERVER VARIABLES FROM CONFIG command handling in Admin_Handler - sqliteserver variables loading during bootstrap in Admin_Bootstrap |
3 months ago |
|
|
5421a382ab |
fix: Load TSDB variables from disk during startup
- TSDB variables stored on disk were not being loaded into runtime during startup. Add the missing `flush_tsdb_variables___database_to_runtime()` and invoke it during init. - Inline the existing load/save wrappers in the header as thin delegations to the underlying flush functions Signed-off-by: Wazir Ahmed <wazir@proxysql.com> |
4 months ago |
|
|
9c6945fae8
|
Merge branch 'v3.0' into v3.0-tsdb-feature
Signed-off-by: René Cannaò <rene@proxysql.com> |
4 months ago |
|
|
4a6809b60f
|
Merge branch 'v3.0' into v3.0-tsdb-feature
Signed-off-by: René Cannaò <rene@proxysql.com> |
4 months ago |
|
|
2a46c239be |
Add PostgreSQL advanced eventslog schema and variable scaffolding
|
4 months ago |
|
|
013864b36f |
MCP: introduce profile-based target/auth routing and unified LOAD/SAVE MCP PROFILES commands
This commit introduces the core MCP routing architecture that decouples client-facing target selection from backend connection details. Architecture introduced: - New MCP auth profile table to store backend credentials/policy (`mcp_auth_profiles`). - New MCP target profile table to map opaque `target_id` -> protocol/hostgroup/auth profile (`mcp_target_profiles`). - Runtime mirrors for both profile tables. Behavioral changes: - MCP query tools resolve execution context by `target_id` and route internally by protocol + hostgroup. - Client no longer needs backend-specific connection details; only logical target identifiers. - Unified admin commands for profile lifecycle management: - `LOAD MCP PROFILES TO/FROM MEMORY/RUNTIME/DISK` - `SAVE MCP PROFILES TO/FROM MEMORY/RUNTIME/DISK` Design goals: - Support multi-backend MCP execution (MySQL + PostgreSQL) behind one endpoint. - Provide server-side credential management and cleaner operational model. - Replace legacy one-backend POC configuration with scalable target/auth abstractions. Result: - MCP routing is now dynamic, protocol-agnostic at the client layer, and fully managed through profile tables and unified load/save commands. |
4 months ago |
|
|
5f5b7d604f |
tsdb: improve administrative interface and command support
- Move 'stats_tsdb' to 'main' schema for better visibility in 'SHOW TSDB STATUS'. - Implement 'PROXYSQL TSDB DOWNSAMPLE' command to trigger manual metrics aggregation. - Ensure 'SHOW TSDB STATUS' triggers a statistics refresh before returning data. - Integrate 'tsdb-' variables into 'runtime_global_variables' refresh logic. - Update TAP tests to verify new commands and improve troubleshooting output. |
4 months ago |
|
|
2d51aeff64 |
tsdb: correctly implement SHOW TSDB commands and variable initialization
|
4 months ago |
|
|
48bc7dd7bf |
Merge v4.0 GenAI features into v3.0 with conditional compilation
This commit merges the experimental v4.0 GenAI/MCP features into the stable v3.0 branch using conditional compilation. All v4.0 features are disabled by default and only enabled when PROXYSQLGENAI=1 is set at compile time. Changes: Build System: - Modified main Makefile to pass PROXYSQLGENAI flag to sub-makefiles - Modified deps/Makefile to conditionally build sqlite-vec and sqlite-rembed - Modified lib/Makefile to add PSQLGA flag and include GenAI object files - Modified src/Makefile to add PSQLGA flag and conditional linking Headers (wrapped with #ifdef PROXYSQLGENAI): - All 20 new GenAI header files in include/ - Modified cpp.h, proxysql_glovars.hpp, proxysql_admin.h - Modified ProxySQL_Admin_Tables_Definitions.h for GenAI/MCP tables Source Files: - All 22 new GenAI source files in lib/ wrapped with #ifdef PROXYSQLGENAI - Modified src/main.cpp for conditional global variables and init/shutdown - Modified Admin_Handler.cpp for conditional command handlers - Modified Admin_Bootstrap.cpp for conditional table registration - Modified Admin_FlushVariables.cpp for conditional variable flushing - Modified ProxySQL_Admin.cpp for conditional admin methods - Modified ProxySQL_Admin_Stats.cpp for conditional MCP stats functions - Modified proxy_sqlite3_symbols.cpp to always compile (needed by core) - Modified MySQL_Session.cpp for conditional GenAI function calls Test Files: - Renamed test_mcp_query_rules-t to test_mcp_query_rules-t.sh - Renamed test_mcp_rag_metrics-t to test_mcp_rag_metrics-t.sh - Modified anomaly_detection-t.cpp for conditional test execution Usage: # Build without GenAI (v3.0 mode - default) make clean && make build_deps -j$(nproc) && make build_lib -j$(nproc) && make build_src -j$(nproc) # Build with GenAI (v4.0 mode) make clean && PROXYSQLGENAI=1 make build_deps -j$(nproc) && PROXYSQLGENAI=1 make build_lib -j$(nproc) && PROXYSQLGENAI=1 make build_src -j$(nproc) |
4 months ago |
|
|
fec97bbabe |
fix: Fix GENAI variable loading during 'ProxySQL_Admin::init'
|
5 months ago |
|
|
22c4e94d53 |
AI: Fix sqlite-vec extension loading
Signed-off-by: Wazir Ahmed <wazir@proxysql.com> |
5 months ago |
|
|
af28598b23
|
Merge pull request #19 from ProxySQL/v3.1-MCP2_QR
feat: Add MCP query rules and digest statistics [WIP] |
5 months ago |
|
|
0db022a179 |
Apply fixes
|
5 months ago |
|
|
2dfd61a958 |
Replace remaining direct sqlite3_* calls with proxy_sqlite3_* equivalents (address code-review)
|
5 months ago |
|
|
7e6f9f0ab3 |
fix: Add MCP query rules LOAD/SAVE command handlers
- Add separate MCP QUERY RULES command block in Admin_Handler - Fix string length comparison (21 chars for "SAVE/LOAD MCP QUERY RULES ") - Add handlers for: - LOAD MCP QUERY RULES TO RUNTIME - SAVE MCP QUERY RULES TO DISK - SAVE MCP QUERY RULES TO MEMORY / FROM RUNTIME - Register mcp_query_rules in disk database (tables_defs_config) Previously MCP commands were incorrectly nested inside MYSQL/PGSQL block and could not be reached. Now they have their own conditional block. |
5 months ago |
|
|
f01fc79584 |
feat: Add runtime_mcp_query_rules table and fix stats_mcp_query_rules schema
- Add ADMIN_SQLITE_TABLE_RUNTIME_MCP_QUERY_RULES schema (17 columns, same as mcp_query_rules) - Fix STATS_SQLITE_TABLE_MCP_QUERY_RULES to only have rule_id and hits columns - Add runtime_mcp_query_rules detection and refresh in ProxySQL_Admin - Implement save_mcp_query_rules_from_runtime(bool _runtime) for both config and runtime tables - Update get_mcp_query_rules() to return 17 columns (no hits) - get_stats_mcp_query_rules() returns 2 columns (rule_id, hits) Mirrors the MySQL query rules pattern: - mcp_query_rules: config table (17 cols) - runtime_mcp_query_rules: runtime state (17 cols) - stats_mcp_query_rules: hit counters (2 cols) |
5 months ago |
|
|
fb66af7c1b |
feat: Expose MCP catalog database in ProxySQL Admin interface
The MCP catalog database is now accessible as the 'mcp_catalog' schema from the ProxySQL Admin interface, enabling direct SQL queries against discovered schemas and LLM memories. |
5 months ago |
|
|
a816a756d4 |
feat: Add MCP query tool usage counters to stats schema
Add stats_mcp_query_tools_counters and stats_mcp_query_tools_counters_reset tables to track MCP query tool usage statistics. - Added get_tool_usage_stats_resultset() method to Query_Tool_Handler - Defined table schemas in ProxySQL_Admin_Tables_Definitions.h - Registered tables in Admin_Bootstrap.cpp - Added pattern matching in ProxySQL_Admin.cpp - Added stats___mcp_query_tools_counters() in ProxySQL_Admin_Stats.cpp - Fixed friend declaration for track_tool_invocation() - Fixed Discovery_Schema.cpp log_llm_search() to use prepare_v2/finalize |
5 months ago |
|
|
ef07831780 |
Add MCP module to admin bootstrap and SHOW MCP VARIABLES command
The MCP module was not being loaded because:
1. The admin bootstrap process was not calling flush_mcp_variables___database_to_runtime
- Added the call after flush_sqliteserver_variables___database_to_runtime
2. There was no SHOW MCP VARIABLES command handler
- Added the handler in Admin_Handler.cpp, following the same pattern as
SHOW MYSQL VARIABLES and SHOW PGSQL VARIABLES
Now after this change:
- MCP variables (mcp-enabled, mcp-port, mcp-mysql_hosts, etc.) will be
automatically inserted into global_variables table during ProxySQL startup
- Users can run "SHOW MCP VARIABLES" to list all MCP configuration variables
- The configure_mcp.sh script will work correctly
Note: Requires rebuilding ProxySQL for changes to take effect.
|
5 months ago |
|
|
01d654692d |
Integrate sqlite-rembed for text embedding generation
Add support for sqlite-rembed Rust SQLite extension to enable text embedding generation from remote AI APIs (OpenAI, Nomic, Ollama, Cohere, etc.) within ProxySQL's SQLite3 Server. Changes: 1. Build system integration for Rust static library compilation - Rust toolchain detection in deps/Makefile - Static library target: sqlite3/libsqlite_rembed.a - Linking integration in lib/Makefile and src/Makefile 2. Extension auto-registration in Admin_Bootstrap.cpp - Declare sqlite3_rembed_init() extern C function - Register via sqlite3_auto_extension() after sqlite-vec 3. Documentation updates - doc/sqlite-rembed-integration.md: comprehensive integration guide - doc/SQLite3-Server.md: usage examples and provider list 4. Source code inclusion - deps/sqlite3/sqlite-rembed-source/: upstream sqlite-rembed v0.0.1-alpha.9 The integration follows the same pattern as sqlite-vec (static linking with auto-registration). Provides rembed() function and temp.rembed_clients virtual table for embedding generation. Build requires Rust toolchain (cargo, rustc) and clang/libclang-dev. |
6 months ago |
|
|
d55947b49f |
Add comprehensive documentation for sqlite-vec integration
This commit adds extensive documentation for the sqlite-vec vector search extension integration in ProxySQL, including: ## README Documentation ### deps/sqlite3/README.md - Overview of sqlite-vec and its vector search capabilities - Integration method using static linking - Directory structure explanation - Compilation flags and build process details - Usage examples for all ProxySQL databases - Benefits and verification instructions ### deps/sqlite3/sqlite-vec-source/README.md - Complete sqlite-vec documentation - Source files explanation - Integration specifics for ProxySQL - Licensing information - Standalone building instructions - Performance considerations ## Doxygen Code Documentation ### lib/Admin_Bootstrap.cpp - Added comprehensive doxygen comments for sqlite-vec integration - Documented sqlite3_vec_init function declaration - Added section documentation for SQLite database initialization - Detailed documentation for each database instance: * Admin: Configuration analytics and vector operations * Stats: Performance metrics and similarity analysis * Config: Configuration optimization with vectors * Monitor: Anomaly detection and pattern recognition * Stats Disk: Historical trend analysis - Included usage examples and cross-references - Explained auto-extension mechanism and integration benefits The documentation provides developers with a complete reference for understanding, using, and maintaining the sqlite-vec integration in ProxySQL's SQLite databases. Technical Details: - Static linking implementation - Virtual table mechanism - JSON vector format support - Auto-extension registration - Multi-database integration - Performance optimizations |
6 months ago |
|
|
fbd0d9732b |
Add sqlite-vec static extension for vector search in ProxySQL
This commit integrates sqlite-vec (https://github.com/asg017/sqlite-vec) as a statically linked extension, enabling vector search capabilities in all ProxySQL SQLite databases (admin, stats, config, monitor). Changes: 1. Added sqlite-vec source files to deps/sqlite3/sqlite-vec-source/ - sqlite-vec.c: main extension source - sqlite-vec.h: header for static linking - sqlite-vec.h.tmpl: template header 2. Modified deps/Makefile: - Added target sqlite3/sqlite3/vec.o that copies sources and compiles with flags -DSQLITE_CORE -DSQLITE_VEC_STATIC - Made sqlite3 target depend on vec.o 3. Modified lib/Makefile: - Added $(SQLITE3_LDIR)/vec.o to libproxysql.a prerequisites - Included vec.o in the static library archive 4. Modified lib/Admin_Bootstrap.cpp: - Added extern "C" declaration for sqlite3_vec_init - Enabled load extension support for all databases: - admindb, statsdb, configdb, monitordb, statsdb_disk - Registered sqlite3_vec_init as auto-extension at database open (replacing commented sqlite3_json_init) 5. Updated top-level Makefile: - Made GIT_VERSION fallback to git describe --always when tags missing Result: - Vector search functions (vec0 virtual tables, vector operations) are available in all ProxySQL SQLite databases without runtime dependencies - No separate shared library required; fully embedded in proxysql binary - Extension automatically loaded at database initialization |
6 months ago |
|
|
3b4369bba9
|
Merge pull request #5113 from wazir-ahmed/load-from-config-validation
Add validation for `LOAD * FROM CONFIG` |
8 months ago |
|
|
0292b780e9 |
Fixed typo
|
8 months ago |
|
|
f3ea179384 |
Add backend PID/state to stats_pgsql_processlist and create pg_stat_activity-style view
- Added `backend_pid` and `backend_state` columns to `stats_pgsql_processlist` to display PostgreSQL backend process ID and connection state. - Created `stats_pgsql_stat_activity` view on top of `stats_pgsql_processlist` with column aliases matching PostgreSQL's `pg_stat_activity` for consistency. |
8 months ago |
|
|
2b72e723e8 |
Add INFO log when values from configuration file are ignored
Signed-off-by: Wazir Ahmed <wazir@proxysql.com> |
9 months ago |