[pgpool-committers: 4225] pgpool: Fix ancient bug of stream write modules.

Tatsuo Ishii ishii at postgresql.org
Tue Aug 29 16:08:50 JST 2017


Fix ancient bug of stream write modules.

- Fix bug with pool_write_noerror() when requested length exceeds
  remaining write buffer size. This could lead to a buffer overrun
  problem, which has not been reported in the field as far as I know
  though.

- When write buffer is full, pool_flush_it() is called, which could
  write data to socket in the middle of message. I found this by using
  following pgproto data. To fix the problem directly write requested
  data if the write buffer is going to be full.

  'P'	""	"SELECT * FROM pgbench_accounts LIMIT 100"	0
  'B'	""	""	0	0	0
  'E'	""	0
  'S'
  'Y'
  'X'

- Enhance performance of pool_unread(). When retrieving large number
  of rows in streaming replication and extended query, pool_unread is
  very slow because it needs to memmove large number of bytes in the
  read buffer. This happens in read_kind_from_backend() since it uses
  pool_unread() to check 'A' packet. To optimize the situation, modify
  pool_unread(). If there's enough room in front of cp->po, copies the
  data there to avoid memmove.

Branch
------
master

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

Modified Files
--------------
src/utils/pool_stream.c | 148 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 140 insertions(+), 8 deletions(-)



More information about the pgpool-committers mailing list