diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-08-29 08:45:04 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-08-29 08:45:04 +0900 |
commit | f593c5517d14a949ae659eec470eb6bc0d2fdd5d (patch) | |
tree | 84811d924432c62254a0e70607f8be67796b5a06 /src/backend/parser/parse_utilcmd.c | |
parent | 36e4419d1f1ef06bba58a28a870aaaa8de73bb46 (diff) | |
download | postgresql-f593c5517d14a949ae659eec470eb6bc0d2fdd5d.tar.gz postgresql-f593c5517d14a949ae659eec470eb6bc0d2fdd5d.zip |
Tweak pg_promote() to report failures on kill() or postmaster failures
Since its introduction in 10074651e335, pg_promote() has been returning
a false status in three cases:
- SIGUSR1 not sent to the postmaster process.
- Postmaster death during standby promotion.
- Standby not promoted within the specified wait time.
An application calling this function will have a hard time understanding
what a false state returned actually means.
Per discussion, this switches the two first states to fail rather than
return a "false" status, making the second case more consistent with the
existing CHECK_FOR_INTERRUPTS in the wait loop. False is only returned
when the promotion is not completed within the specified time (60s by
default).
Author: Ashutosh Sharma
Reviewed-by: Fujii Masao, Laurenz Albe, Michael Paquier
Discussion: https://postgr.es/m/CAE9k0P=QTrwptL0t4J0fuBRDDjgsT-0PVKd-ikd96i1hyL7Bcg@mail.gmail.com
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions