diff --git a/maxctrl/lib/common.js b/maxctrl/lib/common.js index 5fca838f8..f1e58f9ac 100644 --- a/maxctrl/lib/common.js +++ b/maxctrl/lib/common.js @@ -142,6 +142,9 @@ module.exports = function() { if (this.argv.tsv) { // Based on the regex found in: https://github.com/jonschlinkert/strip-color str = str.replace( /\x1B\[[(?);]{0,2}(;?\d)*./g, '') + + // Trim trailing whitespace that cli-table generates + str = str.split(os.EOL).map(s => s.split('\t').map(s => s.trimEnd()).join('\t')).join(os.EOL) } return str } diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 8c91b4c27..a55446c06 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -428,6 +428,14 @@ static void sigfatal_handler(int i) cnf->sysname, cnf->release_string); + if (DCB* dcb = dcb_get_current()) + { + if (dcb->session) + { + session_dump_statements(dcb->session); + } + } + auto cb = [](const char* symbol, const char* cmd) { MXS_ALERT(" %s: %s", symbol, cmd); }; diff --git a/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc b/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc index 0416150fe..10d94dcc9 100644 --- a/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc +++ b/server/modules/routing/readwritesplit/rwsplit_session_cmd.cc @@ -151,8 +151,8 @@ void RWSplitSession::process_sescmd_response(RWBackend* backend, GWBUF** ppPacke { if (cmd == MYSQL_REPLY_ERR && m_sescmd_responses[id] != MYSQL_REPLY_ERR) { - MXS_INFO("Session command failed on slave '%s': %s", - backend->name(), extract_error(*ppPacket).c_str()); + MXS_WARNING("Session command failed on slave '%s': %s", + backend->name(), extract_error(*ppPacket).c_str()); } discard_if_response_differs(backend, m_sescmd_responses[id], cmd, sescmd); diff --git a/test/maxscale_test.cnf b/test/maxscale_test.cnf index d2a9ff810..3006e6c45 100644 --- a/test/maxscale_test.cnf +++ b/test/maxscale_test.cnf @@ -1,5 +1,5 @@ [maxscale] -threads=4 +threads=auto libdir=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_LIBDIR@ logdir=@CMAKE_INSTALL_PREFIX@/log/maxscale/ datadir=@CMAKE_INSTALL_PREFIX@/lib/maxscale @@ -8,13 +8,37 @@ language=@CMAKE_INSTALL_PREFIX@/lib/maxscale/ piddir=@CMAKE_INSTALL_PREFIX@/run/maxscale/ admin_auth=false +[server1] +type=server +address=127.0.0.1 +port=3000 +protocol=MariaDBBackend + +[server2] +type=server +address=127.0.0.1 +port=3001 +protocol=MariaDBBackend + +[server3] +type=server +address=127.0.0.1 +port=3002 +protocol=MariaDBBackend + +[server4] +type=server +address=127.0.0.1 +port=3003 +protocol=MariaDBBackend + [MariaDB-Monitor] type=monitor module=mariadbmon servers=server1,server2,server3,server4 user=maxuser password=maxpwd -monitor_interval=10000 +monitor_interval=5000 [RW-Split-Router] type=service @@ -22,7 +46,6 @@ router=readwritesplit servers=server1,server2,server3,server4 user=maxuser password=maxpwd -max_slave_connections=100% [SchemaRouter-Router] type=service @@ -30,7 +53,6 @@ router=schemarouter servers=server1,server2,server3,server4 user=maxuser password=maxpwd -auth_all_servers=1 [RW-Split-Hint-Router] type=service @@ -38,7 +60,6 @@ router=readwritesplit servers=server1,server2,server3,server4 user=maxuser password=maxpwd -max_slave_connections=100% filters=Hint [Read-Connection-Router] @@ -54,21 +75,6 @@ filters=QLA type=filter module=hintfilter -[recurse3] -type=filter -module=tee -service=RW-Split-Router - -[recurse2] -type=filter -module=tee -service=Read-Connection-Router - -[recurse1] -type=filter -module=tee -service=RW-Split-Hint-Router - [QLA] type=filter module=qlafilter @@ -77,10 +83,6 @@ append=false flush=true filebase=/tmp/qla.log -[CLI] -type=service -router=cli - [Read-Connection-Listener] type=listener service=Read-Connection-Router @@ -105,32 +107,12 @@ service=RW-Split-Hint-Router protocol=MariaDBClient port=4009 +[CLI] +type=service +router=cli + [CLI-Listener] type=listener service=CLI protocol=maxscaled socket=default - -[server1] -type=server -address=127.0.0.1 -port=3000 -protocol=MariaDBBackend - -[server2] -type=server -address=127.0.0.1 -port=3001 -protocol=MariaDBBackend - -[server3] -type=server -address=127.0.0.1 -port=3002 -protocol=MariaDBBackend - -[server4] -type=server -address=127.0.0.1 -port=3003 -protocol=MariaDBBackend diff --git a/test/maxscale_test_secondary.cnf b/test/maxscale_test_secondary.cnf index d0eb78095..b16a12179 100644 --- a/test/maxscale_test_secondary.cnf +++ b/test/maxscale_test_secondary.cnf @@ -1,5 +1,5 @@ [maxscale] -threads=4 +threads=auto libdir=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_LIBDIR@ logdir=@CMAKE_INSTALL_PREFIX@/secondary/log/maxscale/ datadir=@CMAKE_INSTALL_PREFIX@/secondary/lib/maxscale @@ -10,13 +10,37 @@ persistdir=@CMAKE_INSTALL_PREFIX@/secondary/lib/maxscale/maxscale.cnf.d/ admin_auth=false admin_port=8990 +[server1] +type=server +address=127.0.0.1 +port=3000 +protocol=MariaDBBackend + +[server2] +type=server +address=127.0.0.1 +port=3001 +protocol=MariaDBBackend + +[server3] +type=server +address=127.0.0.1 +port=3002 +protocol=MariaDBBackend + +[server4] +type=server +address=127.0.0.1 +port=3003 +protocol=MariaDBBackend + [MariaDB-Monitor] type=monitor module=mariadbmon servers=server1,server2,server3,server4 user=maxuser password=maxpwd -monitor_interval=10000 +monitor_interval=5000 [RW-Split-Router] type=service @@ -24,7 +48,6 @@ router=readwritesplit servers=server1,server2,server3,server4 user=maxuser password=maxpwd -max_slave_connections=100% [SchemaRouter-Router] type=service @@ -32,7 +55,6 @@ router=schemarouter servers=server1,server2,server3,server4 user=maxuser password=maxpwd -auth_all_servers=1 [RW-Split-Hint-Router] type=service @@ -40,7 +62,6 @@ router=readwritesplit servers=server1,server2,server3,server4 user=maxuser password=maxpwd -max_slave_connections=100% filters=Hint [Read-Connection-Router] @@ -56,21 +77,6 @@ filters=QLA type=filter module=hintfilter -[recurse3] -type=filter -module=tee -service=RW-Split-Router - -[recurse2] -type=filter -module=tee -service=Read-Connection-Router - -[recurse1] -type=filter -module=tee -service=RW-Split-Hint-Router - [QLA] type=filter module=qlafilter @@ -79,10 +85,6 @@ append=false flush=true filebase=/tmp/qla2.log -[CLI] -type=service -router=cli - [Read-Connection-Listener] type=listener service=Read-Connection-Router @@ -107,32 +109,12 @@ service=RW-Split-Hint-Router protocol=MariaDBClient port=5009 +[CLI] +type=service +router=cli + [CLI-Listener] type=listener service=CLI protocol=maxscaled socket=/tmp/maxadmin2.sock - -[server1] -type=server -address=127.0.0.1 -port=3000 -protocol=MariaDBBackend - -[server2] -type=server -address=127.0.0.1 -port=3001 -protocol=MariaDBBackend - -[server3] -type=server -address=127.0.0.1 -port=3002 -protocol=MariaDBBackend - -[server4] -type=server -address=127.0.0.1 -port=3003 -protocol=MariaDBBackend