Skip to content

Commit 2317a63

Browse files
Make fast promotion the default promotion mode.
Continue to allow a request for synchronous checkpoints as a mechanism in case of problems.
1 parent 173c252 commit 2317a63

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9906,19 +9906,7 @@ CheckForStandbyTrigger(void)
99069906
fast_promote = false;
99079907
}
99089908

9909-
/*
9910-
* We only look for fast promote via the pg_ctl promote option.
9911-
* It would be possible to extend trigger file support for the
9912-
* fast promotion option but that wouldn't be backwards compatible
9913-
* anyway and we're looking to focus further work on the promote
9914-
* option as the right way to signal end of recovery.
9915-
*/
9916-
if (fast_promote)
9917-
ereport(LOG,
9918-
(errmsg("received fast promote request")));
9919-
else
9920-
ereport(LOG,
9921-
(errmsg("received promote request")));
9909+
ereport(LOG, (errmsg("received promote request")));
99229910

99239911
ResetPromoteTriggered();
99249912
triggered = true;
@@ -9934,6 +9922,7 @@ CheckForStandbyTrigger(void)
99349922
(errmsg("trigger file found: %s", TriggerFile)));
99359923
unlink(TriggerFile);
99369924
triggered = true;
9925+
fast_promote = true;
99379926
return true;
99389927
}
99399928
return false;

src/bin/pg_ctl/pg_ctl.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,13 +1107,12 @@ do_promote(void)
11071107
}
11081108

11091109
/*
1110-
* Use two different kinds of promotion file so we can understand
1111-
* the difference between smart and fast promotion.
1110+
* For 9.3 onwards, use fast promotion as the default option.
1111+
* Promotion with a full checkpoint is still possible by writing
1112+
* a file called "promote", e.g.
1113+
* snprintf(promote_file, MAXPGPATH, "%s/promote", pg_data);
11121114
*/
1113-
if (shutdown_mode >= FAST_MODE)
1114-
snprintf(promote_file, MAXPGPATH, "%s/fast_promote", pg_data);
1115-
else
1116-
snprintf(promote_file, MAXPGPATH, "%s/promote", pg_data);
1115+
snprintf(promote_file, MAXPGPATH, "%s/fast_promote", pg_data);
11171116

11181117
if ((prmfile = fopen(promote_file, "w")) == NULL)
11191118
{
@@ -1778,7 +1777,7 @@ do_help(void)
17781777
" [-o \"OPTIONS\"]\n"), progname);
17791778
printf(_(" %s reload [-D DATADIR] [-s]\n"), progname);
17801779
printf(_(" %s status [-D DATADIR]\n"), progname);
1781-
printf(_(" %s promote [-D DATADIR] [-s] [-m PROMOTION-MODE]\n"), progname);
1780+
printf(_(" %s promote [-D DATADIR] [-s]\n"), progname);
17821781
printf(_(" %s kill SIGNALNAME PID\n"), progname);
17831782
#if defined(WIN32) || defined(__CYGWIN__)
17841783
printf(_(" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR]\n"
@@ -1817,10 +1816,6 @@ do_help(void)
18171816
printf(_(" fast quit directly, with proper shutdown\n"));
18181817
printf(_(" immediate quit without complete shutdown; will lead to recovery on restart\n"));
18191818

1820-
printf(_("\nPromotion modes are:\n"));
1821-
printf(_(" smart promote after performing a checkpoint\n"));
1822-
printf(_(" fast promote quickly without waiting for checkpoint completion\n"));
1823-
18241819
printf(_("\nAllowed signal names for kill:\n"));
18251820
printf(" ABRT HUP INT QUIT TERM USR1 USR2\n");
18261821

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy