diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index a2f8499e0..2252d33d5 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -11895,8 +11895,8 @@ char * ProxySQL_Admin::load_mysql_query_rules_to_runtime() { } GloQPro->sort(false); GloQPro->load_fast_routing(resultset2); - GloQPro->wrunlock(); GloQPro->commit(); + GloQPro->wrunlock(); } if (resultset) delete resultset; // if (resultset2) delete resultset2; // never delete it. GloQPro saves it diff --git a/lib/Query_Processor.cpp b/lib/Query_Processor.cpp index bd0c2a9b3..9585b3d71 100644 --- a/lib/Query_Processor.cpp +++ b/lib/Query_Processor.cpp @@ -737,10 +737,8 @@ void Query_Processor::sort(bool lock) { // when commit is called, the version number is increased and the this will trigger the mysql threads to get a new Query Processor Table // The operation is asynchronous void Query_Processor::commit() { - pthread_rwlock_wrlock(&rwlock); __sync_add_and_fetch(&version,1); proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 4, "Increasing version number to %d - all threads will notice this and refresh their rules\n", version); - pthread_rwlock_unlock(&rwlock); }; SQLite3_result * Query_Processor::get_stats_commands_counters() {