pgpool2.git / summary / log / commit / refs

commit    3e84ee6fa9d12ed9006ccda7e00dc28d71268b92
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Thu Oct 27 08:04:46 2016 +0000

    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.


src/protocol/pool_process_query.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/protocol/pool_process_query.c b/src/protocol/pool_process_query.c index e435b9721..81f8647ca 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -434,9 +434,11 @@ void send_simplequery_message(POOL_CONNECTION *backend, int len, char *string, i } /* - * wait_for_query_response_with_trans_cleanup(): - * this function is the wrapper over the wait_for_query_response() function and performs - * and additional step of canceling the transaction in case of an error from wait_for_query_response() + * wait_for_query_response_with_trans_cleanup(): this function is the wrapper + * over the wait_for_query_response() function and performs and additional + * step of canceling the transaction in case of an error from + * wait_for_query_response() if operated in native replication mode to keep + * database consistency. */ void wait_for_query_response_with_trans_cleanup(POOL_CONNECTION *frontend, POOL_CONNECTION *backend, int protoVersion, int pid, int key) @@ -447,13 +449,16 @@ void wait_for_query_response_with_trans_cleanup(POOL_CONNECTION *frontend, POOL_ } PG_CATCH(); { - /* Cancel current transaction */ - CancelPacket cancel_packet; + if (REPLICATION) + { + /* Cancel current transaction */ + CancelPacket cancel_packet; - cancel_packet.protoVersion = htonl(PROTO_CANCEL); - cancel_packet.pid = pid; - cancel_packet.key= key; - cancel_request(&cancel_packet); + cancel_packet.protoVersion = htonl(PROTO_CANCEL); + cancel_packet.pid = pid; + cancel_packet.key= key; + cancel_request(&cancel_packet); + } PG_RE_THROW(); } [parent: c097d1fe0585]