Re: [HACKERS] Optional message to user when terminating/cancelling backend
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Eren Başak <eren@citusdata.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Yugo Nagata <nagata@sraoss.co.jp>,
Thomas Munro <thomas.munro@enterprisedb.com>,
Michael Paquier <michael.paquier@gmail.com>,
PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-03-29T14:54:42Z
Lists: pgsql-hackers
Attachments
- 0001-Refactor-backend-signalling-code-v9.patch (application/octet-stream) patch v9-0001
- 0002-Support-optional-message-in-backend-cancel-terminate-v9.patch (application/octet-stream) patch v9-0002
> On 27 Mar 2018, at 13:50, Eren Başak <eren@citusdata.com> wrote: > > pg_cancel_backend() is defined proisstrict, while pg_cancel_backend_msg() is > > not. I think we must be able to perform the cancellation if the message is > > NULL, so made it two functions. > > I agree that we should preserve the old usage as well. What I don't understand is that, can't we remove proisstrict from pg_cancel_backend and copy the body of pg_cancel_backend_msg into pg_cancel_backend. This way, I think we can accomplish the same thing without introducing two new functions. If we do that, wouldn’t SELECT pg_cancel_backend(NULL) fail unless NULL is explicitly casted to integer? Also, I think that would cause make check to fail the opr_sanity suite on the “multiple uses of the same internal function” test. Maybe I’m misunderstanding your point here? > pg_terminate_backend_msg errors out if the pid is null but pg_cancel_backend_msg returns null and I think we should have consistency between these two in this regard. Absolutely, that was an oversight in the v8 patch, they should both handle NULL in the same way. Whitespace and null handling fixed, as well as rebased over HEAD. cheers ./daniel
Commits
-
Refactor user-facing SQL functions signalling backends
- 09921f397b84 12.0 landed
-
Introduce 64-bit hash functions with a 64-bit seed.
- 81c5e46c490e 11.0 cited