pgpool2.git / summary / log / commit / refs

commit    c0fae3d690e5a8762c994cc9736f61da88b888db
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sun Jul 08 22:21:33 2012 +0000

    Fix pool_process_query() bug reported in [pgpool-general: 672].
    > For some reason, this transaction was aborted, client disconnected
    > from pgpool, pgpool aborted the transaction on the slave server
    > (192.168.10.11) but not on the master (192.168.10.55).
    This is caused by the function waits for primary node which does not
    have pending data, while standbys have pending data.


pool_process_query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pool_process_query.c b/pool_process_query.c index ea1d0cce1..d65cd269b 100644 --- a/pool_process_query.c +++ b/pool_process_query.c @@ -234,7 +234,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend, { /* Ok, query is not in progress. * ProcessFrontendResponse() may consume all pending - * data. Check if we have any pending data. If no, + * data. Check if we have any pending data. If not, * call read_packets_and_process() and wait for data * arrival. */ @@ -250,7 +250,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend, else { /* If we have pending data in master, we need to process it */ - if (!pool_ssl_pending(MASTER(backend)) && + if (pool_ssl_pending(MASTER(backend)) || !pool_read_buffer_is_empty(MASTER(backend))) { status = ProcessBackendResponse(frontend, backend, &state, &num_fields); @@ -265,7 +265,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend, continue; if (pool_ssl_pending(CONNECTION(backend, i)) || - pool_read_buffer_is_empty(CONNECTION(backend, i))) + !pool_read_buffer_is_empty(CONNECTION(backend, i))) { /* If we have pending data in master, we need to process it */ if (IS_MASTER_NODE_ID(i)) [parent: 3ef16429986d]