mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Make fast promotion the default promotion mode.
Continue to allow a request for synchronous checkpoints as a mechanism in case of problems.
This commit is contained in:
parent
173c252bb2
commit
2317a63328
@ -9906,19 +9906,7 @@ CheckForStandbyTrigger(void)
|
|||||||
fast_promote = false;
|
fast_promote = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
ereport(LOG, (errmsg("received promote request")));
|
||||||
* We only look for fast promote via the pg_ctl promote option.
|
|
||||||
* It would be possible to extend trigger file support for the
|
|
||||||
* fast promotion option but that wouldn't be backwards compatible
|
|
||||||
* anyway and we're looking to focus further work on the promote
|
|
||||||
* option as the right way to signal end of recovery.
|
|
||||||
*/
|
|
||||||
if (fast_promote)
|
|
||||||
ereport(LOG,
|
|
||||||
(errmsg("received fast promote request")));
|
|
||||||
else
|
|
||||||
ereport(LOG,
|
|
||||||
(errmsg("received promote request")));
|
|
||||||
|
|
||||||
ResetPromoteTriggered();
|
ResetPromoteTriggered();
|
||||||
triggered = true;
|
triggered = true;
|
||||||
@ -9934,6 +9922,7 @@ CheckForStandbyTrigger(void)
|
|||||||
(errmsg("trigger file found: %s", TriggerFile)));
|
(errmsg("trigger file found: %s", TriggerFile)));
|
||||||
unlink(TriggerFile);
|
unlink(TriggerFile);
|
||||||
triggered = true;
|
triggered = true;
|
||||||
|
fast_promote = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1107,13 +1107,12 @@ do_promote(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use two different kinds of promotion file so we can understand
|
* For 9.3 onwards, use fast promotion as the default option.
|
||||||
* the difference between smart and fast promotion.
|
* Promotion with a full checkpoint is still possible by writing
|
||||||
|
* a file called "promote", e.g.
|
||||||
|
* snprintf(promote_file, MAXPGPATH, "%s/promote", pg_data);
|
||||||
*/
|
*/
|
||||||
if (shutdown_mode >= FAST_MODE)
|
|
||||||
snprintf(promote_file, MAXPGPATH, "%s/fast_promote", pg_data);
|
snprintf(promote_file, MAXPGPATH, "%s/fast_promote", pg_data);
|
||||||
else
|
|
||||||
snprintf(promote_file, MAXPGPATH, "%s/promote", pg_data);
|
|
||||||
|
|
||||||
if ((prmfile = fopen(promote_file, "w")) == NULL)
|
if ((prmfile = fopen(promote_file, "w")) == NULL)
|
||||||
{
|
{
|
||||||
@ -1778,7 +1777,7 @@ do_help(void)
|
|||||||
" [-o \"OPTIONS\"]\n"), progname);
|
" [-o \"OPTIONS\"]\n"), progname);
|
||||||
printf(_(" %s reload [-D DATADIR] [-s]\n"), progname);
|
printf(_(" %s reload [-D DATADIR] [-s]\n"), progname);
|
||||||
printf(_(" %s status [-D DATADIR]\n"), progname);
|
printf(_(" %s status [-D DATADIR]\n"), progname);
|
||||||
printf(_(" %s promote [-D DATADIR] [-s] [-m PROMOTION-MODE]\n"), progname);
|
printf(_(" %s promote [-D DATADIR] [-s]\n"), progname);
|
||||||
printf(_(" %s kill SIGNALNAME PID\n"), progname);
|
printf(_(" %s kill SIGNALNAME PID\n"), progname);
|
||||||
#if defined(WIN32) || defined(__CYGWIN__)
|
#if defined(WIN32) || defined(__CYGWIN__)
|
||||||
printf(_(" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR]\n"
|
printf(_(" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR]\n"
|
||||||
@ -1817,10 +1816,6 @@ do_help(void)
|
|||||||
printf(_(" fast quit directly, with proper shutdown\n"));
|
printf(_(" fast quit directly, with proper shutdown\n"));
|
||||||
printf(_(" immediate quit without complete shutdown; will lead to recovery on restart\n"));
|
printf(_(" immediate quit without complete shutdown; will lead to recovery on restart\n"));
|
||||||
|
|
||||||
printf(_("\nPromotion modes are:\n"));
|
|
||||||
printf(_(" smart promote after performing a checkpoint\n"));
|
|
||||||
printf(_(" fast promote quickly without waiting for checkpoint completion\n"));
|
|
||||||
|
|
||||||
printf(_("\nAllowed signal names for kill:\n"));
|
printf(_("\nAllowed signal names for kill:\n"));
|
||||||
printf(" ABRT HUP INT QUIT TERM USR1 USR2\n");
|
printf(" ABRT HUP INT QUIT TERM USR1 USR2\n");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user