From 3c2fc5c53899be8828c31a2b54d0acbc322655e5 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Thu, 27 Oct 2016 17:29:53 +0900 Subject: [PATCH] Do not cancel a query when the query resulted in an error other than in native replication mode. It was intended to keep the consistency, but there's no point in other than native replication mode. --- pool_query_context.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pool_query_context.c b/pool_query_context.c index 145124677..1b3e65b5b 100644 --- a/pool_query_context.c +++ b/pool_query_context.c @@ -744,13 +744,16 @@ POOL_STATUS pool_send_and_wait(POOL_QUERY_CONTEXT *query_context, if (wait_for_query_response(frontend, CONNECTION(backend, i), MAJOR(backend)) != POOL_CONTINUE) { - /* Cancel current transaction */ - CancelPacket cancel_packet; + if (REPLICATION) + { + /* Cancel current transaction */ + CancelPacket cancel_packet; - cancel_packet.protoVersion = htonl(PROTO_CANCEL); - cancel_packet.pid = MASTER_CONNECTION(backend)->pid; - cancel_packet.key= MASTER_CONNECTION(backend)->key; - cancel_request(&cancel_packet); + cancel_packet.protoVersion = htonl(PROTO_CANCEL); + cancel_packet.pid = MASTER_CONNECTION(backend)->pid; + cancel_packet.key= MASTER_CONNECTION(backend)->key; + cancel_request(&cancel_packet); + } return POOL_END; } -- 2.39.5