[pgpool-committers: 5203] pgpool: Fix memory leak when query cache enabled in streaming replicati

Tatsuo Ishii ishii at sraoss.co.jp
Thu Oct 11 18:03:07 JST 2018


Fix memory leak when query cache enabled in streaming replication mode + extended query case.

If BEGIN is executed in extended protocol, allocated temp buffer for
the command never discarded.  This is because in streaming replication
mode + extended query case, when handle_query_cache gets called at the
command complete timing, the reference counter to query context is not
0, which in turn prevents from calling
pool_discard_temp_query_cache().

In reality, we don't need to care about the query context here, so
let's proceed in streaming replication mode + extended query case.

Note that the memory leak case can be easily reproduced by "pgbench -M
extended" command (standard TPC-B).

Branch
------
V4_0_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=6b95ad5d37353ea713c2c16c94f17b283cd5a04c

Modified Files
--------------
src/query_cache/pool_memqcache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



More information about the pgpool-committers mailing list