From 379cb6c781eba2c66ef261beae222463715b938f Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 5 Feb 2016 13:54:24 +0200 Subject: [PATCH] MXS-564: Slave server states were not properly cleared after session commands When a command that changes the session state is executed on all servers and a slave server goes down, an error message was sent to the client even though one wasn't expected. These appeared as odd connection errors on the client side. --- .../modules/routing/readwritesplit/readwritesplit.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 71f6ce11f..63ef48661 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -2834,11 +2834,9 @@ static void clientReply ( * This applies to session commands only. Counter decrement * for other type of queries is done outside this block. */ - if (writebuf != NULL && client_dcb != NULL) - { - /** Set response status as replied */ - bref_clear_state(bref, BREF_WAITING_RESULT); - } + + /** Set response status as replied */ + bref_clear_state(bref, BREF_WAITING_RESULT); } /** * Clear BREF_QUERY_ACTIVE flag and decrease waiter counter. @@ -3756,8 +3754,8 @@ static GWBUF* sescmd_cursor_process_replies( if(bref->reply_cmd != scmd->reply_cmd) { - MXS_INFO("Backend server '%s' response differs from master's response. " - "Closing connection.", + MXS_ERROR("Slave server '%s': response differs from master's response. " + "Closing connection due to inconsistent session state.", bref->bref_backend->backend_server->unique_name); sescmd_cursor_set_active(scur,false); bref_clear_state(bref,BREF_QUERY_ACTIVE);