[Pgpool-committers] pgpool - pgpool-II: Fix bug with SimpleForwardToFrontend().

User T-ishii t-ishii at pgfoundry.org
Mon Jul 20 12:16:55 UTC 2009


Log Message:
-----------
Fix bug with SimpleForwardToFrontend().  Clients using the extend
protocol send 'H'(Flush) after each command. Problem is,
SimpleForwardToFrontend does not immediately forward 'C'(Command
Complete) packet to frontend. So the client sends 'H' and wait for
'C'. On the other hand backend receives 'H' but reply back nothing
since Command complete has nothing to be returned. Both side stuck.

The fix is, forwarding 'C' packet immediately after receiving it from
backend. To prevent similar bugs happen in the future, I put
pool_flush(frontend) after calling SimpleForwardToFrontend in
pool_process_query() (other places already do this).

The extra pool_flush() might harm performance. So I did some tests
using pgbench -S, and found nothing has been changed regarding
performance after patching.

Bug report from Gavin Sherry along with patches for
SimpleForwardToFrontend().

Modified Files:
--------------
    pgpool-II:
        pool_process_query.c (r1.147 -> r1.148)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/pool_process_query.c?r1=1.147&r2=1.148)


More information about the Pgpool-committers mailing list