postgresql/src/include/replication
Andres Freund 2f6501fa3c Move replication slot release to before_shmem_exit().
Previously, replication slots were released in ProcKill() on error, resulting
in reporting replication slot drop of ephemeral slots after the stats
subsystem was already shut down.

To fix this problem, move replication slot release to a before_shmem_exit()
hook that is called before the stats collector shuts down. There wasn't really
a good reason for the slot handling to be in ProcKill() anyway.

Patch by Masahiko Sawada, with very minor polishing by me.

I, Andres, wrote a test for dropping slots during process exit, but there may
be some OS dependent issues around the number of times FATAL error messages
are displayed due to a still debated libpq issue. So that test will be
committed separately / later.

Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-By: Andres Freund <andres@anarazel.de>
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CAD21AoDAeEpAbZEyYJsPZJUmSPaRicVSBObaL7sPaofnKz+9zg@mail.gmail.com
2022-02-14 17:08:17 -08:00
..
backup_manifest.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
basebackup.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
basebackup_sink.h Add suport for server-side LZ4 base backup compression. 2022-02-11 08:29:38 -05:00
decode.h Logical decoding of sequences 2022-02-10 18:43:51 +01:00
logical.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicallauncher.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicalproto.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicalrelation.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicalworker.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
message.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
origin.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
output_plugin.h Logical decoding of sequences 2022-02-10 18:43:51 +01:00
pgoutput.h Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
reorderbuffer.h Logical decoding of sequences 2022-02-10 18:43:51 +01:00
slot.h Move replication slot release to before_shmem_exit(). 2022-02-14 17:08:17 -08:00
snapbuild.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
syncrep.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walreceiver.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walsender.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walsender_private.h Fix limitations on what SQL commands can be issued to a walsender. 2022-01-24 15:33:38 -05:00
worker_internal.h Update copyright for 2022 2022-01-07 19:04:57 -05:00