[pgpool-committers: 8663] pgpool: When CloseComplete is received, foward to frontend without buff

Tatsuo Ishii ishii at sraoss.co.jp
Sat Jun 4 21:18:37 JST 2022


When CloseComplete is received, foward to frontend without buffering.

It seems occasional timeour error in 074.bug700_memqcache_segfault seems to be caused by the buildfarm log as of
[pgpool-buildfarm: 2158] Pgpool-II buildfarm results CentOS7
* master  PostgreSQL 12  CentOS7
testing 074.bug700_memqcache_segfault...timeout.

From the pgpool.log:
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  pool_discard_temp_query_cache: cache discarded: 0x1be53e8
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache reset buffer
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  discard: 0x1be57a8
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache discarding query cache array
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  num_caches: 0
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache reset buffer
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  create: 0x1be57a8
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache reset buffer
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  discard temp buffer of 0x1be7c08 (SELECT 1)
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  CloseComplete: remove sent message. kind:B, name:P1
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  processing command complete
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  set transaction state to T
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache reset buffer
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  discard: 0x1be57a8
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache discarding query cache array
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  num_caches: 0
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache reset buffer
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  create: 0x1be57a8
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  memcache reset buffer
2022-05-28 17:14:52.612: pgproto pid 45886: DETAIL:  discard temp buffer of 0x1be7c08 (SELECT 1)
2022-05-28 17:14:52.612: pgproto pid 45886: DEBUG:  CloseComplete: remove sent message. kind:B, name:P2

It seems the CloseComplete message was received from backend but if looking into results.txt:

FE=> Query (query="SET statement_timeout TO 1000")
<= BE CommandComplete(SET)
<= BE ReadyForQuery(I)
FE=> Parse(stmt="S1", query="SELECT 1")
FE=> Bind(stmt="S1", portal="P1")
FE=> Execute(portal="P1")
FE=> Close(portal="P1")
FE=> Bind(stmt="S1", portal="P2")
FE=> Execute(portal="P2")
FE=> Close(portal="P2")
FE=> Sync
<= BE ParseComplete
<= BE BindComplete
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE CloseComplete
<= BE BindComplete
<= BE DataRow
<= BE CommandComplete(SELECT 1)

It seems the frontend did not receive the CloseComplete
message. SimpleForwardToFrontend() did buffering when it forwarded the
CloseComplete message. I guess this is the cause of the timeout. So
let's change SimpleForwardToFrontend() so that it forwards
CloseComplete message without buffering and see what buildfarm says.

Branch
------
V4_3_STABLE

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

Modified Files
--------------
src/protocol/pool_process_query.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)



More information about the pgpool-committers mailing list