From 2874c9ad54561cfe50f14d5bebc22a49e53fec13 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sun, 11 Jan 2026 17:09:53 +0000 Subject: [PATCH] Fix flush_mcp_variables___database_to_runtime to populate runtime_global_variables The MCP module's flush_mcp_variables___database_to_runtime() was missing the logic to populate runtime_global_variables table. This caused the table to remain empty even though global_variables was correctly populated. Following the same pattern as admin variables (line 268), this commit adds: 1. Call to flush_mcp_variables___runtime_to_database(admindb, ..., true) to populate runtime_global_variables 2. Checksum generation for cluster sync After this fix, both global_variables and runtime_global_variables will contain MCP variables after ProxySQL startup. --- lib/Admin_FlushVariables.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Admin_FlushVariables.cpp b/lib/Admin_FlushVariables.cpp index 4dd5bf853..09a47220f 100644 --- a/lib/Admin_FlushVariables.cpp +++ b/lib/Admin_FlushVariables.cpp @@ -1228,6 +1228,14 @@ void ProxySQL_Admin::flush_mcp_variables___database_to_runtime(SQLite3DB* db, bo GloMCPH->wrunlock(); delete resultset; } + + // Also populate runtime_global_variables (same pattern as admin variables) + { + pthread_mutex_lock(&GloVars.checksum_mutex); + flush_mcp_variables___runtime_to_database(admindb, false, false, false, true); + flush_GENERIC_variables__checksum__database_to_runtime("mcp", checksum, epoch); + pthread_mutex_unlock(&GloVars.checksum_mutex); + } } void ProxySQL_Admin::flush_mcp_variables___runtime_to_database(SQLite3DB* db, bool replace, bool del, bool onlyifempty, bool runtime, bool use_lock) {