diff --git a/maxscale-system-test/session_limits.cpp b/maxscale-system-test/session_limits.cpp index c162db948..84c75972a 100644 --- a/maxscale-system-test/session_limits.cpp +++ b/maxscale-system-test/session_limits.cpp @@ -40,11 +40,11 @@ int main(int argc, char *argv[]) test.maxscales->connect_maxscale(0); for (int i = 0; i < 10; i++) { - test.try_query(test.maxscales->conn_rwsplit[0], "set @test=1"); + test.try_query(test.maxscales->conn_rwsplit[0], std::string("set @test=" + std::to_string(i)).c_str()); } test.tprintf("Execute one more session command and expect message in error log"); - execute_query(test.maxscales->conn_rwsplit[0], "set @test=1"); + execute_query(test.maxscales->conn_rwsplit[0], "set @test=11"); sleep(1); test.check_log_err(0, "Router session exceeded session command history limit", true); test.maxscales->close_maxscale_connections(0); diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index 78a5a9445..65727dc0c 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -379,10 +379,15 @@ bool route_session_write(RWSplitSession *rses, GWBUF *querybuf, if (rses->rses_config.max_sescmd_history > 0 && rses->sescmd_list.size() >= rses->rses_config.max_sescmd_history) { - MXS_WARNING("Router session exceeded session command history limit. " - "Slave recovery is disabled and only slave servers with " - "consistent session state are used " - "for the duration of the session."); + static bool warn_history_exceeded = true; + if (warn_history_exceeded) + { + MXS_WARNING("Router session exceeded session command history limit. Slave " + "recovery is disabled and only slave servers with consistent " + "session state are used for the duration of the session."); + warn_history_exceeded = false; + } + rses->rses_config.disable_sescmd_history = true; rses->rses_config.max_sescmd_history = 0; rses->sescmd_list.clear();