Re: A new function to wait for the backend exit after termination
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Magnus Hagander <magnus@hagander.net>,
"David G. Johnston" <david.g.johnston@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-10-31T10:58:18Z
Lists: pgsql-hackers
Attachments
- v3-0001-pg_terminate_backend-with-wait-timeout-and-pg_wai.patch (application/x-patch) patch v3-0001
On Wed, Oct 28, 2020 at 6:41 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote: > > I prefer that false is returned when the timeout happens, > like pg_promote() does. > Done. > > When the specified timeout is negative, the following error is thrown *after* > SIGTERM is signaled to the target backend. This seems strange to me. > The timeout value should be verified at the beginning of the function, instead. > > ERROR: timeout cannot be negative > I'm not throwing error for this case, instead a warning and returning false. This is to keep it consistent with other cases such as the given pid is not a backend pid. Attaching the v3 patch. I tried to address the review comments received so far and added documentation. I tested the patch locally here. I saw that we don't have any test cases for existing pg_terminate_backend(), do we need to add test cases into regression suites for these two new functions? Please review the v3 patch and let me know comments. With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com
Commits
-
Copy-edit text for the pg_terminate_backend() "timeout" parameter.
- 0aac73e6a260 14.0 landed
-
Remove pg_wait_for_backend_termination().
- 5f1df62a459b 14.0 landed
-
Add functions to wait for backend termination
- aaf043257205 14.0 landed
-
Fix typo in comment.
- 6742e14959a3 14.0 cited