[pgpool-hackers: 15] Pgpool goes into infinite loop

Tatsuo Ishii ishii at postgresql.org
Sat Dec 24 11:32:25 JST 2011


Recently some people reported that pgpool goes into infinite loop and
consumes 100% of cpu time. A user reported me privately that the
problem started with pgpool-II 3.0.4 (released on June 1st, 2011). So
I took a look at the commits made between 3.0.3 and 3.0.4, and found
possible commit which created the problem:

http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=74181f5a940ee441a237bfc9f423b3c7b5a5274b;hp=02bed576f5dd100b9e5ba51ad9fb0338c4d16972

Untill 3.0.3 we had a code path to process requests from backends at
any condition by calling ProcessBackendResponse(see line 402 of
pool_process_query.c of 3.0.3).

		status = ProcessBackendResponse(frontend, backend, &state, &num_fields);

However after 3.0.4, this is not executed and goes into infinite loop
if receive buffer of master is empty *and* one of receive buffer of
slaves are not empty (in case when all backend receive buffers are
empty is processed correctly in any version).

I have fixed this by discarding slaves' receive buffer in this case
because we have to re-sync each backend's buffer anyway.

Fix committed to master, V3_1_STABLE at the moment. I thought the
problem is with 3.1 or later, but as I wrote above, actually the
problem started with 3.0.4, I think I'm going to apply same patches
for 3.0 stable tree.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list