Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vZpmA-000GjU-1T for pgpool-hackers@arkaria.postgresql.org; Sun, 28 Dec 2025 12:21:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vZpm9-00DCRs-1M for pgpool-hackers@arkaria.postgresql.org; Sun, 28 Dec 2025 12:21:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vZpm8-00DCRj-2e for pgpool-hackers@lists.postgresql.org; Sun, 28 Dec 2025 12:21:34 +0000 Received: from mail-yx1-xb135.google.com ([2607:f8b0:4864:20::b135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vZpm4-0030zE-1O for pgpool-hackers@lists.postgresql.org; Sun, 28 Dec 2025 12:21:32 +0000 Received: by mail-yx1-xb135.google.com with SMTP id 956f58d0204a3-6420c0cf4abso6642210d50.1 for ; Sun, 28 Dec 2025 04:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tailorbrands.com; s=google; t=1766924487; x=1767529287; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6GJN98zS/F1SWNQWscF7M9s4f3gYGeF2VQSksBro4P8=; b=Rca4hMdh4bKZcMJlQXJ0+AKBLV3QGXG+4wYm299LFTfs4k2lI29ctv51ZncIY2YAGd APreoD5rzTZLDk3lyhbzKmSM+xIjprWoxtbSSh/+FTFh3UOVf+lbOaJS0pZ0T/BmPEb+ uXgiKLlxz91o6d8eGLfTWaB0SC91yTYeK876s/A0Z8yVQXQ1T9rItOkyT3ZDG+cP2+7+ 1xShvXlvbaGc6SVrHAKNuIJiL2gxgFWbsuNYSfJDkb7AOcryiy2hFbEUTRh0kCgY4wPg HgwSfKMh6Wzr2TX1AZIFAJANkmR65NtLThxf/DuKIPtoJdqioNfzKyqFkFUAe0EZPbmk OEHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766924487; x=1767529287; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6GJN98zS/F1SWNQWscF7M9s4f3gYGeF2VQSksBro4P8=; b=JBPzThZUSC029c1E58MtQAaQ7DNtEze4PaQpPH5RCoFfUCK1DvOSKv14V7TxK22vhx I/lyRkaSZwzlcjdUlLMr7M4K/n8k8yxrujVTgOZqwU9SQj/x57yk1NllnQGuMAGCoZaT vQNJj+TB6pvxLCPdDQD+vWVdx7m7yvp/zpE6CJFbfyHXQtRtyspnS07uAQg6gaCGrJZ2 lb/Aou5dKKWHrWtAzKkUgKHHzZBk/+wkWPlxpU+qYJhJRLywtK0qhiaGyyiypZ1umB9i aH7Lo3wiT9TZKBBuxH7cOMEn95js3YtVHeKWom7r0kz4QgLPDaLH525hWsLU6XT2LhFg ufUg== X-Gm-Message-State: AOJu0Yxm+Ug2zQHiwfgPKZrDjtL2CROy36w9ASt69OqG8cA0m0YxmEOO n1HAd4xS6UMu9v74xYF/M1H+f/5U09cn7iFK8Alr6csuBf1S8Kmgk50s+A+0pS4+PlL9Kx6kBuW AVPXagRRZXV8gcJ2L48wC9w3pDlG05WlBBjWqj3LyLnF4bPoj2KDFlTg= X-Gm-Gg: AY/fxX7S2W+k5Jl/egHGURK4T3yLLCjh6Jj2WMl6yWmriXhh3Ih+VTmecmkAquQuf0e phy1scYSItKt5jamTcCVsXPipOZE5F/LnaQ7BSqptByrtQD4GmB+Sfa6BhpI4tY6H3HNMslzUH+ o2oSPhOlR+xHrvPolUvhRMnS9I7XJVDjfQByreECezoHZFW+qSi+os2gqU6/mxOoHDqk8dI/NvM TdDatZINVyjq94DHc1C98R235R5hi/d2PHVFGT5gBwEB2J23oj0Q4ujZLwvjDxsbuJerFmM+sP+ /Dmq2ghEj6pYAb2AMOnCYbLVonYTkWmxmROsWcMy6CZ/Gop3X5th9BeAupeCdntSjENC X-Google-Smtp-Source: AGHT+IEaX1+ht0hUBfgaeIx68lK8XbHn1twWVhPxjUf5ODr7meAmbDl6XwskfBt0hXJS51HTjmd1b9WB7fcxYVWS3+A= X-Received: by 2002:a05:690e:1882:b0:646:7ae4:11e9 with SMTP id 956f58d0204a3-6467ae419b5mr18514337d50.15.1766924486396; Sun, 28 Dec 2025 04:21:26 -0800 (PST) MIME-Version: 1.0 References: <20251223.174625.653233061559427537.ishii@postgresql.org> <20251226.165446.148265507050550257.ishii@postgresql.org> <20251226.190349.1321105398044197651.ishii@postgresql.org> In-Reply-To: <20251226.190349.1321105398044197651.ishii@postgresql.org> From: Nadav Shatz Date: Sun, 28 Dec 2025 14:21:15 +0200 X-Gm-Features: AQt7F2p-CdzrCGAKuiYiuIRDxpgBPkuNuIBDRVCALyGnIX-vkD5UNTOKyulEjPE Message-ID: Subject: Re: Proposal: recent access based routing for primary-replica setups To: Tatsuo Ishii Cc: pgpool-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000005b70b30647022a5c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005b70b30647022a5c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable thank you! works for me. should we merge both into master or do you want me to send a combined one? On Fri, Dec 26, 2025 at 12:03=E2=80=AFPM Tatsuo Ishii wrote: > Hi Nadav, > > I just want to make it clear. The patch should be applied on top of > your latest.patch. > > > (Please disregard previous mail. I seem to have mangled the message). > > > > I think I found a cause of the problem. On Linux, if SIGCHLD is > > ignored (set to SIG_IGN), waitpid() cannot get proper child status. > > Because the kernel relcaims the resource for the child process to not > > make the child process a zombie. And this makes waitpid() to fail with > > ECHLD. Since the return of waitpid() is not checked, I did not notice > > the waitpid() failure (I recommend to check the return value of > > waitpid()). > > > > /* set up signal handlers */ > > signal(SIGALRM, SIG_DFL); > > signal(SIGTERM, my_signal_handler); > > signal(SIGINT, my_signal_handler); > > signal(SIGHUP, reload_config_handler); > > signal(SIGQUIT, my_signal_handler); > > signal(SIGCHLD, SIG_IGN); <--- SIGCHLD is ignored > > signal(SIGUSR1, my_signal_handler); > > signal(SIGUSR2, SIG_IGN); > > signal(SIGPIPE, SIG_IGN); > > > > To fix this, either change the line above to: > > > > signal(SIGCHLD, SIG_DFL); > > or > > signal(SIGCHLD, my_signal_handler); > > and modify my_signal_handler. > > > > I recommend the latter, because it does not depend on the default > > behavior of SIGCHLD, which might be different per platform. > > Attached is the patch to do this. (and run pgindent). > > I also notice that something like: > > > > /* Count tokens in output for validation */ > > char *line_copy =3D pstrdup(line); > > char *temp_token =3D strtok(line_copy, " \t\n"); > > > > You should declare line_copy and temp_token in the begging of the code > > block (or in the outer block). The forward declaration is recommended > > coding style in Pgpool-II (and PostgreSQL). Same thing can be said to > > some other variables. > > > > Best regards, > > -- > > Tatsuo Ishii > > SRA OSS K.K. > > English: http://www.sraoss.co.jp/index_en/ > > Japanese:http://www.sraoss.co.jp > > > >> Hi Tatsuo, > >> > >> Thank you for the note. > >> > >> I've removed the docker stuff. started working in an ubuntu 24 VM to > match > >> the setup. hopefully the results will be better, had so many issues > >> compiling and testing before that stuff wasn't properly formulated. > >> > >> Attaching the latest patch. > >> > >> this is what i'm seeing: > >> adav@lima-dev:/src/pgpool2/src/test/regression$ PGHOST=3D/tmp > ./regress.sh -p > >> /usr/bin 041.external_replication_delay > >> creating pgpool-II temporary installation ... > >> moving pgpool_setup to temporary installation path ... > >> moving watchdog_setup to temporary installation path ... > >> using pgpool-II at /src/pgpool2/src/test/regression/temp/installed > >> ************************* > >> REGRESSION MODE : install > >> Pgpool-II version : pgpool-II version 4.8devel (mitsukakeboshi) > >> Pgpool-II install path : > /src/pgpool2/src/test/regression/temp/installed > >> PostgreSQL bin : /usr/lib/postgresql/16/bin > >> PostgreSQL Major version : 16 > >> pgbench : /usr/lib/postgresql/16/bin/pgbench > >> PostgreSQL jdbc : > >> /usr/local/pgsql/share/postgresql-9.2-1003.jdbc4.jar > >> ************************* > >> testing 041.external_replication_delay...ok. > >> out of 1 ok:1 failed:0 timeout:0 > >> > >> > >> > >> On Tue, Dec 23, 2025 at 10:46=E2=80=AFAM Tatsuo Ishii > wrote: > >> > >>> > Hi Tatsuo, > >>> > > >>> > I'km running into issues testing this and have created a full docke= r > >>> > compose setup - can you please point me to up to date guides on the > best > >>> > way to run the tests so i know we're doing it the same way? > >>> > > >>> > Thank you for all your help! > >>> > >>> I have run the regression test on the Pgpool-II master branch on my > >>> Ubuntu 24 box. > >>> > >>> cd pgpool2/src/test/regression > >>> ./regress.sh 041 > >>> > >>> This time I noticed: > >>> > >>> - The patch does not named with version number > >>> - The patch creates .dockerignore and docker/ directory. > >>> > >>> Are they intended? I am asking because they are different from the > >>> previous version. > >>> > >>> > On Tue, Dec 23, 2025 at 2:13=E2=80=AFAM Tatsuo Ishii > >>> wrote: > >>> > > >>> >> > I think everything is passing now. new version attached. > >>> >> > >>> >> Unfortunately Test1 did not pass. > >>> >> > >>> >> =3D=3D=3D Test1: Basic external command with integer millisecond v= alues > =3D=3D=3D > >>> >> waiting for server to start....1438600 2025-12-23 09:09:48.337 JST > LOG: > >>> >> redirecting log output to logging collector process > >>> >> 1438600 2025-12-23 09:09:48.337 JST HINT: Future log output will > appear > >>> >> in directory "log". > >>> >> done > >>> >> server started > >>> >> waiting for server to start....1438617 2025-12-23 09:09:48.443 JST > LOG: > >>> >> redirecting log output to logging collector process > >>> >> 1438617 2025-12-23 09:09:48.443 JST HINT: Future log output will > appear > >>> >> in directory "log". > >>> >> done > >>> >> server started > >>> >> waiting for server to start....1438634 2025-12-23 09:09:48.561 JST > LOG: > >>> >> redirecting log output to logging collector process > >>> >> 1438634 2025-12-23 09:09:48.561 JST HINT: Future log output will > appear > >>> >> in directory "log". > >>> >> done > >>> >> server started > >>> >> CREATE TABLE > >>> >> Waiting for sr_check to run... > >>> >> Command executed after 1 seconds > >>> >> node_id | hostname | port | status | pg_status | lb_weight | > role > >>> | > >>> >> pg_role | select_cnt | load_balance_node | replication_delay | > >>> >> replication_state | replication_sync_state | last_status_change > >>> >> > >>> >> > >>> > ---------+-----------+-------+--------+-----------+-----------+---------+= ---------+------------+-------------------+-------------------+------------= -------+------------------------+--------------------- > >>> >> 0 | localhost | 11002 | up | up | 0.333333 | > primary > >>> | > >>> >> primary | 0 | true | 0 | > >>> >> | | 2025-12-23 09:09:49 > >>> >> 1 | localhost | 11003 | up | up | 0.333333 | > standby > >>> | > >>> >> standby | 0 | false | 0 | > >>> >> | | 2025-12-23 09:09:49 > >>> >> 2 | localhost | 11004 | up | up | 0.333333 | > standby > >>> | > >>> >> standby | 0 | false | 0 | > >>> >> | | 2025-12-23 09:09:49 > >>> >> (3 rows) > >>> >> > >>> >> fail: external command delay logging not found > >>> >> > >>> >> > On Mon, Nov 24, 2025 at 9:41=E2=80=AFAM Tatsuo Ishii < > ishii@postgresql.org> > >>> >> wrote: > >>> >> > > >>> >> >> Thank you for updating the patch! This time the patch applies > without > >>> >> >> any issue and compiles fine. Unfortunately regression test > failed. > >>> >> >> > >>> >> >> testing 041.external_replication_delay...failed. > >>> >> >> > >>> >> >> From the regression log, it seems Test7 failed. > >>> >> >> > >>> >> >> > >>> >> > >>> > -------------------------------------------------------------------------= ----- > >>> >> >> =3D=3D=3D Test7: Command timeout handling =3D=3D=3D > >>> >> >> waiting for server to start....411181 2025-11-24 16:31:05.244 J= ST > >>> LOG: > >>> >> >> redirecting log output to logging collector process > >>> >> >> 411181 2025-11-24 16:31:05.244 JST HINT: Future log output wil= l > >>> appear > >>> >> in > >>> >> >> directory "log". > >>> >> >> done > >>> >> >> server started > >>> >> >> waiting for server to start....411196 2025-11-24 16:31:05.352 J= ST > >>> LOG: > >>> >> >> redirecting log output to logging collector process > >>> >> >> 411196 2025-11-24 16:31:05.352 JST HINT: Future log output wil= l > >>> appear > >>> >> in > >>> >> >> directory "log". > >>> >> >> done > >>> >> >> server started > >>> >> >> waiting for server to start....411213 2025-11-24 16:31:05.461 J= ST > >>> LOG: > >>> >> >> redirecting log output to logging collector process > >>> >> >> 411213 2025-11-24 16:31:05.461 JST HINT: Future log output wil= l > >>> appear > >>> >> in > >>> >> >> directory "log". > >>> >> >> done > >>> >> >> server started > >>> >> >> Waiting for command timeout... > >>> >> >> fail: command timeout not detected > >>> >> >> > >>> >> >> > >>> >> > >>> > -------------------------------------------------------------------------= ----- > >>> >> >> > >>> >> >> Attached is the pgpool.log. If you need more info, please let m= e > >>> know. > >>> >> >> > >>> >> >> Best regards, > >>> >> >> -- > >>> >> >> Tatsuo Ishii > >>> >> >> SRA OSS K.K. > >>> >> >> English: http://www.sraoss.co.jp/index_en/ > >>> >> >> Japanese:http://www.sraoss.co.jp > >>> >> >> > >>> >> >> > >>> >> >> > Hi Tatsuo, > >>> >> >> > > >>> >> >> > Sorry again, this was due to the separation of 2 patches and = i > only > >>> >> sent > >>> >> >> > the one. > >>> >> >> > > >>> >> >> > I've merged it into 1 commit and 1 patch and rebased over > master to > >>> >> avoid > >>> >> >> > these issues moving forward. > >>> >> >> > > >>> >> >> > PFA latest version > >>> >> >> > > >>> >> >> > On Thu, Nov 20, 2025 at 1:09=E2=80=AFAM Tatsuo Ishii < > ishii@postgresql.org > >>> > > >>> >> >> wrote: > >>> >> >> > > >>> >> >> >> Hi Nadav, > >>> >> >> >> > >>> >> >> >> Thank you for new patch. > >>> >> >> >> Unfortunately the patch did not apply to current master. > >>> >> >> >> > >>> >> >> >> $ git apply > >>> >> >> >> > ~/0001-Fix-multiple-issues-in-external-replication-delay-fe.patch > >>> >> >> >> error: patch failed: > >>> >> src/streaming_replication/pool_worker_child.c:694 > >>> >> >> >> error: src/streaming_replication/pool_worker_child.c: patch > does > >>> not > >>> >> >> apply > >>> >> >> >> > >>> >> >> >> Maybe the patch is on top of your previous patch? > >>> >> >> >> > >>> >> >> >> Also I suggest to use "-v" option of "git format-patch" to > add the > >>> >> >> >> patch version number so that we can easily know which patch > is the > >>> >> >> >> latest. > >>> >> >> >> > >>> >> >> >> Best regards, > >>> >> >> >> -- > >>> >> >> >> Tatsuo Ishii > >>> >> >> >> SRA OSS K.K. > >>> >> >> >> English: http://www.sraoss.co.jp/index_en/ > >>> >> >> >> Japanese:http://www.sraoss.co.jp > >>> >> >> >> > >>> >> >> >> > Hi Tatsuo, > >>> >> >> >> > > >>> >> >> >> > Please see attached an updated version. > >>> >> >> >> > > >>> >> >> >> > thank you > >>> >> >> >> > > >>> >> >> >> > On Fri, Nov 7, 2025 at 2:07=E2=80=AFAM Tatsuo Ishii < > >>> ishii@postgresql.org> > >>> >> >> >> wrote: > >>> >> >> >> > > >>> >> >> >> >> > Sorry for that - thanks for the patch. > >>> >> >> >> >> > > >>> >> >> >> >> > Please find attached a new version > >>> >> >> >> >> > >>> >> >> >> >> Thanks for the new version. Unfortunately this time > regression > >>> >> test > >>> >> >> >> >> fails at: > >>> >> >> >> >> > >>> >> >> >> >> > Waiting for command timeout... > >>> >> >> >> >> > fail: command timeout not detected > >>> >> >> >> >> > >>> >> >> >> >> Attached is the pgpool.log. > >>> >> >> >> >> > >>> >> >> >> >> Best regards, > >>> >> >> >> >> -- > >>> >> >> >> >> Tatsuo Ishii > >>> >> >> >> >> SRA OSS K.K. > >>> >> >> >> >> English: http://www.sraoss.co.jp/index_en/ > >>> >> >> >> >> Japanese:http://www.sraoss.co.jp > >>> >> >> >> >> > >>> >> >> >> >> > On Mon, Nov 3, 2025 at 9:05=E2=80=AFAM Tatsuo Ishii < > >>> >> ishii@postgresql.org> > >>> >> >> >> >> wrote: > >>> >> >> >> >> > > >>> >> >> >> >> >> > thanks and sorry for the issues, please find attache= d > >>> updated > >>> >> >> >> version. > >>> >> >> >> >> >> > >>> >> >> >> >> >> No problem. > >>> >> >> >> >> >> > >>> >> >> >> >> >> This time the patch applies fine, no compiler warnings= . > >>> >> However, > >>> >> >> >> >> >> regression test did not passed here (on Ubuntu 24 LTS = if > >>> this > >>> >> >> >> >> >> matters). So I looked into > >>> >> >> >> >> >> > >>> >> src/test/regression/tests/041.external_replication_delay/test.sh a > >>> >> >> >> >> >> little bit and apply attached patch (test.sh.patch). I= t > >>> moved > >>> >> >> forward > >>> >> >> >> >> >> partially but failed at: > >>> >> >> >> >> >> > >>> >> >> >> >> >> fail: command execution failure not detected > >>> >> >> >> >> >> > >>> >> >> >> >> >> Please find attached > >>> >> >> >> >> >> > >>> >> >> >> >> > >>> >> >> >> > >>> >> >> > >>> >> > >>> > src/test/regression/tests/041.external_replication_delay/testdir/pgpool.l= og > >>> >> >> >> >> >> and > src/test/regression/log/041.external_replication_delay. > >>> >> >> >> >> >> > >>> >> >> >> >> >> Best regards, > >>> >> >> >> >> >> -- > >>> >> >> >> >> >> Tatsuo Ishii > >>> >> >> >> >> >> SRA OSS K.K. > >>> >> >> >> >> >> English: http://www.sraoss.co.jp/index_en/ > >>> >> >> >> >> >> Japanese:http://www.sraoss.co.jp > >>> >> >> >> >> >> > >>> >> >> >> >> > > >>> >> >> >> >> > > >>> >> >> >> >> > -- > >>> >> >> >> >> > Nadav Shatz > >>> >> >> >> >> > Tailor Brands | CTO > >>> >> >> >> >> > >>> >> >> >> > > >>> >> >> >> > > >>> >> >> >> > -- > >>> >> >> >> > Nadav Shatz > >>> >> >> >> > Tailor Brands | CTO > >>> >> >> >> > >>> >> >> > > >>> >> >> > > >>> >> >> > -- > >>> >> >> > Nadav Shatz > >>> >> >> > Tailor Brands | CTO > >>> >> >> > >>> >> > > >>> >> > > >>> >> > -- > >>> >> > Nadav Shatz > >>> >> > Tailor Brands | CTO > >>> >> > >>> > > >>> > > >>> > -- > >>> > Nadav Shatz > >>> > Tailor Brands | CTO > >>> > >> > >> > >> -- > >> Nadav Shatz > >> Tailor Brands | CTO > --=20 Nadav Shatz Tailor Brands | CTO --0000000000005b70b30647022a5c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
thank you! works for me. should we merge both into master = or do you want me to send a combined one?

On Fri, Dec = 26, 2025 at 12:03=E2=80=AFPM Tatsuo Ishii <ishii@postgresql.org> wrote:
Hi Nadav,

I just want to make it clear. The patch should be applied on top of
your latest.patch.

> (Please disregard previous mail. I seem to have mangled the message).<= br> >
> I think I found a cause of the problem. On Linux, if SIGCHLD is
> ignored (set to SIG_IGN), waitpid() cannot get proper child status. > Because the kernel relcaims the resource for the child process to not<= br> > make the child process a zombie. And this makes waitpid() to fail with=
> ECHLD. Since the return of waitpid() is not checked, I did not notice<= br> > the waitpid() failure (I recommend to check the return value of
> waitpid()).
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0/* set up signal handlers */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGALRM, SIG_DFL);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGTERM, my_signal_handler);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGINT, my_signal_handler);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGHUP, reload_config_handler);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGQUIT, my_signal_handler);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGCHLD, SIG_IGN);=C2=A0 =C2=A0 =C2= =A0 =C2=A0<--- SIGCHLD is ignored
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGUSR1, my_signal_handler);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGUSR2, SIG_IGN);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGPIPE, SIG_IGN);
>
> To fix this, either change the line above to:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGCHLD, SIG_DFL);
> or
>=C2=A0 =C2=A0 =C2=A0 =C2=A0signal(SIGCHLD, my_signal_handler);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0and modify my_signal_handler.
>
> I recommend the latter, because it does not depend on the default
> behavior of SIGCHLD, which might be different per platform.
> Attached is the patch to do this. (and run pgindent).
> I also notice that something like:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Count tokens = in output for validation */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0char *line_copy = =3D pstrdup(line);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0char *temp_token= =3D strtok(line_copy, " \t\n");
>
> You should declare line_copy and temp_token in the begging of the code=
> block (or in the outer block).=C2=A0 The forward declaration is recomm= ended
> coding style in Pgpool-II (and PostgreSQL). Same thing can be said to<= br> > some other variables.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS K.K.
> English: http://www.sraoss.co.jp/index_en/
> Japanese:http://www.sraoss.co.jp
>
>> Hi Tatsuo,
>>
>> Thank you for the note.
>>
>> I've removed the docker stuff. started working in an ubuntu 24= VM to match
>> the setup. hopefully the results will be better, had so many issue= s
>> compiling and testing before that stuff wasn't properly formul= ated.
>>
>> Attaching the latest patch.
>>
>> this is what i'm seeing:
>> adav@lima-dev:/src/pgpool2/src/test/regression$ PGHOST=3D/tmp ./re= gress.sh -p
>> /usr/bin 041.external_replication_delay
>> creating pgpool-II temporary installation ...
>> moving pgpool_setup to temporary installation path ...
>> moving watchdog_setup to temporary installation path ...
>> using pgpool-II at /src/pgpool2/src/test/regression/temp/installed=
>> *************************
>> REGRESSION MODE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : install
>> Pgpool-II version=C2=A0 =C2=A0 =C2=A0 =C2=A0 : pgpool-II version 4= .8devel (mitsukakeboshi)
>> Pgpool-II install path=C2=A0 =C2=A0: /src/pgpool2/src/test/regress= ion/temp/installed
>> PostgreSQL bin=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: /usr/lib/= postgresql/16/bin
>> PostgreSQL Major version : 16
>> pgbench=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 : /usr/lib/postgresql/16/bin/pgbench
>> PostgreSQL jdbc=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :
>> /usr/local/pgsql/share/postgresql-9.2-1003.jdbc4.jar
>> *************************
>> testing 041.external_replication_delay...ok.
>> out of 1 ok:1 failed:0 timeout:0
>>
>>
>>
>> On Tue, Dec 23, 2025 at 10:46=E2=80=AFAM Tatsuo Ishii <ishii@postgresql.org= > wrote:
>>
>>> > Hi Tatsuo,
>>> >
>>> > I'km running into issues testing this and have create= d a full docker
>>> > compose setup - can you please point me to up to date gui= des on the best
>>> > way to run the tests so i know we're doing it the sam= e way?
>>> >
>>> > Thank you for all your help!
>>>
>>> I have run the regression test on the Pgpool-II master branch = on my
>>> Ubuntu 24 box.
>>>
>>> cd pgpool2/src/test/regression
>>> ./regress.sh 041
>>>
>>> This time I noticed:
>>>
>>> - The patch does not named with version number
>>> - The patch creates .dockerignore and docker/ directory.
>>>
>>> Are they intended? I am asking because they are different from= the
>>> previous version.
>>>
>>> > On Tue, Dec 23, 2025 at 2:13=E2=80=AFAM Tatsuo Ishii <= ishii@postgresql.= org>
>>> wrote:
>>> >
>>> >> > I think everything is passing now. new version a= ttached.
>>> >>
>>> >> Unfortunately Test1 did not pass.
>>> >>
>>> >> =3D=3D=3D Test1: Basic external command with integer = millisecond values =3D=3D=3D
>>> >> waiting for server to start....1438600 2025-12-23 09:= 09:48.337 JST LOG:
>>> >> redirecting log output to logging collector process >>> >> 1438600 2025-12-23 09:09:48.337 JST HINT:=C2=A0 Futur= e log output will appear
>>> >> in directory "log".
>>> >>=C2=A0 done
>>> >> server started
>>> >> waiting for server to start....1438617 2025-12-23 09:= 09:48.443 JST LOG:
>>> >> redirecting log output to logging collector process >>> >> 1438617 2025-12-23 09:09:48.443 JST HINT:=C2=A0 Futur= e log output will appear
>>> >> in directory "log".
>>> >>=C2=A0 done
>>> >> server started
>>> >> waiting for server to start....1438634 2025-12-23 09:= 09:48.561 JST LOG:
>>> >> redirecting log output to logging collector process >>> >> 1438634 2025-12-23 09:09:48.561 JST HINT:=C2=A0 Futur= e log output will appear
>>> >> in directory "log".
>>> >>=C2=A0 done
>>> >> server started
>>> >> CREATE TABLE
>>> >> Waiting for sr_check to run...
>>> >> Command executed after 1 seconds
>>> >>=C2=A0 node_id | hostname=C2=A0 | port=C2=A0 | status = | pg_status | lb_weight |=C2=A0 role
>>>=C2=A0 |
>>> >> pg_role | select_cnt | load_balance_node | replicatio= n_delay |
>>> >> replication_state | replication_sync_state | last_sta= tus_change
>>> >>
>>> >>
>>> ---------+-----------+-------+--------+-----------+-----------= +---------+---------+------------+-------------------+-------------------+-= ------------------+------------------------+---------------------
>>> >>=C2=A0 0=C2=A0 =C2=A0 =C2=A0 =C2=A0| localhost | 11002= | up=C2=A0 =C2=A0 =C2=A0| up=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 0.333333=C2=A0 |= primary
>>> |
>>> >> primary | 0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | true= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 0=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
>>> >>=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 2025-12-23 09:09:49<= br> >>> >>=C2=A0 1=C2=A0 =C2=A0 =C2=A0 =C2=A0| localhost | 11003= | up=C2=A0 =C2=A0 =C2=A0| up=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 0.333333=C2=A0 |= standby
>>> |
>>> >> standby | 0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | false= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 0=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
>>> >>=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 2025-12-23 09:09:49<= br> >>> >>=C2=A0 2=C2=A0 =C2=A0 =C2=A0 =C2=A0| localhost | 11004= | up=C2=A0 =C2=A0 =C2=A0| up=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 0.333333=C2=A0 |= standby
>>> |
>>> >> standby | 0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | false= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 0=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
>>> >>=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 2025-12-23 09:09:49<= br> >>> >> (3 rows)
>>> >>
>>> >> fail: external command delay logging not found
>>> >>
>>> >> > On Mon, Nov 24, 2025 at 9:41=E2=80=AFAM Tatsuo I= shii <ishii@po= stgresql.org>
>>> >> wrote:
>>> >> >
>>> >> >> Thank you for updating the patch! This time = the patch applies without
>>> >> >> any issue and compiles fine. Unfortunately r= egression test failed.
>>> >> >>
>>> >> >> testing 041.external_replication_delay...fai= led.
>>> >> >>
>>> >> >> From the regression log, it seems Test7 fail= ed.
>>> >> >>
>>> >> >>
>>> >>
>>> --------------------------------------------------------------= ----------------
>>> >> >> =3D=3D=3D Test7: Command timeout handling = =3D=3D=3D
>>> >> >> waiting for server to start....411181 2025-1= 1-24 16:31:05.244 JST
>>> LOG:
>>> >> >> redirecting log output to logging collector = process
>>> >> >> 411181 2025-11-24 16:31:05.244 JST HINT:=C2= =A0 Future log output will
>>> appear
>>> >> in
>>> >> >> directory "log".
>>> >> >>=C2=A0 done
>>> >> >> server started
>>> >> >> waiting for server to start....411196 2025-1= 1-24 16:31:05.352 JST
>>> LOG:
>>> >> >> redirecting log output to logging collector = process
>>> >> >> 411196 2025-11-24 16:31:05.352 JST HINT:=C2= =A0 Future log output will
>>> appear
>>> >> in
>>> >> >> directory "log".
>>> >> >>=C2=A0 done
>>> >> >> server started
>>> >> >> waiting for server to start....411213 2025-1= 1-24 16:31:05.461 JST
>>> LOG:
>>> >> >> redirecting log output to logging collector = process
>>> >> >> 411213 2025-11-24 16:31:05.461 JST HINT:=C2= =A0 Future log output will
>>> appear
>>> >> in
>>> >> >> directory "log".
>>> >> >>=C2=A0 done
>>> >> >> server started
>>> >> >> Waiting for command timeout...
>>> >> >> fail: command timeout not detected
>>> >> >>
>>> >> >>
>>> >>
>>> --------------------------------------------------------------= ----------------
>>> >> >>
>>> >> >> Attached is the pgpool.log. If you need more= info, please let me
>>> know.
>>> >> >>
>>> >> >> Best regards,
>>> >> >> --
>>> >> >> Tatsuo Ishii
>>> >> >> SRA OSS K.K.
>>> >> >> English: http://www.sraoss.co.jp/ind= ex_en/
>>> >> >> Japanese:http://www.sraoss.co.jp
>>> >> >>
>>> >> >>
>>> >> >> > Hi Tatsuo,
>>> >> >> >
>>> >> >> > Sorry again, this was due to the separa= tion of 2 patches and i only
>>> >> sent
>>> >> >> > the one.
>>> >> >> >
>>> >> >> > I've merged it into 1 commit and 1 = patch and rebased over master to
>>> >> avoid
>>> >> >> > these issues moving forward.
>>> >> >> >
>>> >> >> > PFA latest version
>>> >> >> >
>>> >> >> > On Thu, Nov 20, 2025 at 1:09=E2=80=AFAM= Tatsuo Ishii <ishii@postgresql.org
>>> >
>>> >> >> wrote:
>>> >> >> >
>>> >> >> >> Hi Nadav,
>>> >> >> >>
>>> >> >> >> Thank you for new patch.
>>> >> >> >> Unfortunately the patch did not app= ly to current master.
>>> >> >> >>
>>> >> >> >> $ git apply
>>> >> >> >> ~/0001-Fix-multiple-issues-in-exter= nal-replication-delay-fe.patch
>>> >> >> >> error: patch failed:
>>> >> src/streaming_replication/pool_worker_child.c:694
>>> >> >> >> error: src/streaming_replication/po= ol_worker_child.c: patch does
>>> not
>>> >> >> apply
>>> >> >> >>
>>> >> >> >> Maybe the patch is on top of your p= revious patch?
>>> >> >> >>
>>> >> >> >> Also I suggest to use "-v"= ; option of "git format-patch" to add the
>>> >> >> >> patch version number so that we can= easily know which patch is the
>>> >> >> >> latest.
>>> >> >> >>
>>> >> >> >> Best regards,
>>> >> >> >> --
>>> >> >> >> Tatsuo Ishii
>>> >> >> >> SRA OSS K.K.
>>> >> >> >> English: http://www.sraoss.= co.jp/index_en/
>>> >> >> >> Japanese:http://www.sraoss.co.jp<= br> >>> >> >> >>
>>> >> >> >> > Hi Tatsuo,
>>> >> >> >> >
>>> >> >> >> > Please see attached an updated= version.
>>> >> >> >> >
>>> >> >> >> > thank you
>>> >> >> >> >
>>> >> >> >> > On Fri, Nov 7, 2025 at 2:07=E2= =80=AFAM Tatsuo Ishii <
>>> ishi= i@postgresql.org>
>>> >> >> >> wrote:
>>> >> >> >> >
>>> >> >> >> >> > Sorry for that - than= ks for the patch.
>>> >> >> >> >> >
>>> >> >> >> >> > Please find attached = a new version
>>> >> >> >> >>
>>> >> >> >> >> Thanks for the new version= . Unfortunately this time regression
>>> >> test
>>> >> >> >> >> fails at:
>>> >> >> >> >>
>>> >> >> >> >> > Waiting for command t= imeout...
>>> >> >> >> >> > fail: command timeout= not detected
>>> >> >> >> >>
>>> >> >> >> >> Attached is the pgpool.log= .
>>> >> >> >> >>
>>> >> >> >> >> Best regards,
>>> >> >> >> >> --
>>> >> >> >> >> Tatsuo Ishii
>>> >> >> >> >> SRA OSS K.K.
>>> >> >> >> >> English: http://ww= w.sraoss.co.jp/index_en/
>>> >> >> >> >> Japanese:http://www.sraoss.c= o.jp
>>> >> >> >> >>
>>> >> >> >> >> > On Mon, Nov 3, 2025 a= t 9:05=E2=80=AFAM Tatsuo Ishii <
>>> >> ishii@postgresql.org>
>>> >> >> >> >> wrote:
>>> >> >> >> >> >
>>> >> >> >> >> >> > thanks and s= orry for the issues, please find attached
>>> updated
>>> >> >> >> version.
>>> >> >> >> >> >>
>>> >> >> >> >> >> No problem.
>>> >> >> >> >> >>
>>> >> >> >> >> >> This time the pat= ch applies fine, no compiler warnings.
>>> >> However,
>>> >> >> >> >> >> regression test d= id not passed here (on Ubuntu 24 LTS if
>>> this
>>> >> >> >> >> >> matters).=C2=A0 S= o I looked into
>>> >> >> >> >> >>
>>> >> src/test/regression/tests/041.external_replication_de= lay/test.sh a
>>> >> >> >> >> >> little bit and ap= ply attached patch (test.sh.patch). It
>>> moved
>>> >> >> forward
>>> >> >> >> >> >> partially but fai= led at:
>>> >> >> >> >> >>
>>> >> >> >> >> >> fail: command exe= cution failure not detected
>>> >> >> >> >> >>
>>> >> >> >> >> >> Please find attac= hed
>>> >> >> >> >> >>
>>> >> >> >> >>
>>> >> >> >>
>>> >> >>
>>> >>
>>> src/test/regression/tests/041.external_replication_delay/testd= ir/pgpool.log
>>> >> >> >> >> >> and src/test/regr= ession/log/041.external_replication_delay.
>>> >> >> >> >> >>
>>> >> >> >> >> >> Best regards,
>>> >> >> >> >> >> --
>>> >> >> >> >> >> Tatsuo Ishii
>>> >> >> >> >> >> SRA OSS K.K.
>>> >> >> >> >> >> English: http://www.sraoss.co.jp/index_en/
>>> >> >> >> >> >> Japanese:http://ww= w.sraoss.co.jp
>>> >> >> >> >> >>
>>> >> >> >> >> >
>>> >> >> >> >> >
>>> >> >> >> >> > --
>>> >> >> >> >> > Nadav Shatz
>>> >> >> >> >> > Tailor Brands | CTO >>> >> >> >> >>
>>> >> >> >> >
>>> >> >> >> >
>>> >> >> >> > --
>>> >> >> >> > Nadav Shatz
>>> >> >> >> > Tailor Brands | CTO
>>> >> >> >>
>>> >> >> >
>>> >> >> >
>>> >> >> > --
>>> >> >> > Nadav Shatz
>>> >> >> > Tailor Brands | CTO
>>> >> >>
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Nadav Shatz
>>> >> > Tailor Brands | CTO
>>> >>
>>> >
>>> >
>>> > --
>>> > Nadav Shatz
>>> > Tailor Brands | CTO
>>>
>>
>>
>> --
>> Nadav Shatz
>> Tailor Brands | CTO


--
Nadav Shatz
<= font color=3D"#000000">Tailor Brands=C2=A0| CTO
--0000000000005b70b30647022a5c--