diff options
author | Fujii Masao <fujii@postgresql.org> | 2019-10-11 15:47:59 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2019-10-11 15:47:59 +0900 |
commit | 20961ceaf0426c6fba40bb422cf111f704a00058 (patch) | |
tree | c31794df3f4ab396c7d69517e32cd1c62246c9b2 /src/backend/access/transam/xlog.c | |
parent | 06a367c382d0a3595238eff2e777222dbc91911b (diff) | |
download | postgresql-20961ceaf0426c6fba40bb422cf111f704a00058.tar.gz postgresql-20961ceaf0426c6fba40bb422cf111f704a00058.zip |
Make crash recovery ignore restore_command and recovery_end_command settings.
In v11 or before, those settings could not take effect in crash recovery
because they are specified in recovery.conf and crash recovery always
starts without recovery.conf. But commit 2dedf4d9a8 integrated
recovery.conf into postgresql.conf and which unexpectedly allowed
those settings to take effect even in crash recovery. This is definitely
not good behavior.
To fix the issue, this commit makes crash recovery always ignore
restore_command and recovery_end_command settings.
Back-patch to v12 where the issue was added.
Author: Fujii Masao
Reviewed-by: Peter Eisentraut
Discussion: https://postgr.es/m/e445616d-023e-a268-8aa1-67b8b335340c@pgmasters.net
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 790e2c8714d..0ff9af53fef 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7610,7 +7610,10 @@ StartupXLOG(void) } else CreateCheckPoint(CHECKPOINT_END_OF_RECOVERY | CHECKPOINT_IMMEDIATE); + } + if (ArchiveRecoveryRequested) + { /* * And finally, execute the recovery_end_command, if any. */ @@ -7618,10 +7621,7 @@ StartupXLOG(void) ExecuteRecoveryCommand(recoveryEndCommand, "recovery_end_command", true); - } - if (ArchiveRecoveryRequested) - { /* * We switched to a new timeline. Clean up segments on the old * timeline. |