Re: [HACKERS] Optional message to user when terminating/cancelling backend
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: 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-01-25T23:05:39Z
Lists: pgsql-hackers
Attachments
- 0001-Refactor-backend-signalling-code-v6.patch (application/octet-stream) patch v6-0001
- 0002-Support-optional-message-in-backend-cancel-terminate-v6.patch (application/octet-stream) patch v6-0002
> On 24 Jan 2018, at 16:45, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > > A quick suggestion from a passer-by -- would you put the new code in > src/backend/storage/ipc/backend_signal.c instead? Sounds like a better > place than utils/misc/; and "signal" is more general in nature than just > "cancel". A bunch of stuff from utils/adt/misc.c (???) can migrate to > the new file -- everything from line 201 to 362 at least, that is: > > pg_signal_backend > pg_cancel_backend > pg_terminate_backend > pg_reload_conf > pg_rotate_logfile +1, this makes a lot of sense. When writing this I didn’t find a good fit anywhere so I modelled it after utils/misc/backend_random.c, not because it was a good fit but it was the least bad one I could come up with. This seems a lot cleaner. > Maybe have two patches, 0001 creates the files moving the contents over, > then 0002 adds your new stuff on top. The two attached patches implements this. > /me wonders if there's anything that would suggest to make this > extensive to processes other than backends ... Perhaps, do you have an API in mind? 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