View Issue Details

IDProjectCategoryView StatusLast Update
0000698Pgpool-IIBugpublic2021-03-21 08:15
Reportervan Assigned Tot-ishii  
PriorityhighSeverityblockReproducibilityalways
Status feedbackResolutionopen 
Product Version4.2.2 
Summary0000698: pgpool chile process keep getting re created
DescriptionHi Team,

We have following configuration.

 num_init_children = 100
max_pool =1
child_life_time = 0
child_max_connections = 0
connection_life_time = 0
client_idle_limit = 60

When pgpool start , it create 100 child process but after some time pgpool keep on existing and re creating new process .

Please can you help us on this issue
TagsNo tags attached.

Activities

van

2021-03-20 05:53

reporter   ~0003775

logs we are getting is :

" child process with pid: 519 exits with status 256"

t-ishii

2021-03-20 07:14

developer   ~0003776

Did not reproduce here. Can you share pgpool debug log?

van

2021-03-21 03:19

reporter   ~0003777

021-03-19 21:48:39: pid 180: DETAIL: statement: "_PLAN0x7f4bd4011060", query: "SELECT <SOME SELECT QUERY > message: "relation "<TABLE NAME>" does not exist"
2021-03-19 21:48:39: pid 180: LOG: Sync message from frontend.
2021-03-19 21:48:39: pid 180: LOG: Bind message from frontend.
2021-03-19 21:48:39: pid 180: DETAIL: portal: "_PLAN0x7f4bd4011060", statement: "_PLAN0x7f4bd4011060"
2021-03-19 21:48:39: pid 180: FATAL: unable to bind
2021-03-19 21:48:39: pid 180: DETAIL: cannot get parse message "_PLAN0x7f4bd4011060"
2021-03-19 21:48:39: pid 180: LOG: frontend disconnection: session time: 0:00:00.003 user=<DATABASE USER> database=<DATABASE NAME> host=<HOST> port=<PORT>
2021-03-19 21:48:39: pid 21: LOG: child process with pid: 180 exits with status 256
2021-03-19 21:48:39: pid 21: LOG: fork a new child process with pid: 233
2021-03-19 21:48:39: pid 118: LOG: new connection received

van

2021-03-21 03:51

reporter   ~0003778

I think behavior is like if DB return error like "relation does not exist"" , pgpool is re spawning the child process

t-ishii

2021-03-21 08:15

developer   ~0003779

Looks like pgpool suicides because it failed to find parse message to bind in its data.
In general, pgpool does not suicide when relation does not found. The only case is this:
- Frontend sends parse (and maybe describe message in your case but I cannot determine because the information is not in the log)
- Pgpool forwards them to PostgreSQL
- Frontend sends sync message and pgpool forwards it to PostgreSQL
- PostgreSQL returns ERROR message because the table does not exist.
- Pgpool forwards the ERROR to frontend
- Despite ERROR is returned, frontend continues with sending bind message
- Pgpool cannot find the parse message corresponding to the bind message and exits
- New pgpool process is forked

I think when Pgpool (PostgreSQL) returns ERROR because the relation is not found, frontend should not continue because subsequent Bind message will fail.
If the frontend does not care about the result of parse or describe message, it should not send sync message in the first place. Other driver for example JDBC does not send sync message after parse or describe. Sync message is not free, it slow downs the process because PostgreSQL needs to generate an intermediate response and sends it.

Probably it would be possible to fix pgpool so that it does not suicide in this case. But I am not sure if it's worth the effort.
I don't know the behavior (ignoring ERROR and keep on sending bind message) is created by the driver or your application but IMO the behavior is not appropriate and it should be fixed first.

Issue History

Date Modified Username Field Change
2021-03-20 05:26 van New Issue
2021-03-20 05:53 van Note Added: 0003775
2021-03-20 07:14 t-ishii Note Added: 0003776
2021-03-21 03:19 van Note Added: 0003777
2021-03-21 03:51 van Note Added: 0003778
2021-03-21 07:51 t-ishii Assigned To => t-ishii
2021-03-21 07:51 t-ishii Status new => feedback
2021-03-21 08:15 t-ishii Note Added: 0003779