]> granicus.if.org Git - postgresql/commitdiff
Make fast promotion the default promotion mode.
authorSimon Riggs <simon@2ndQuadrant.com>
Wed, 24 Apr 2013 11:21:18 +0000 (12:21 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Wed, 24 Apr 2013 11:21:18 +0000 (12:21 +0100)
Continue to allow a request for synchronous
checkpoints as a mechanism in case of problems.

src/backend/access/transam/xlog.c
src/bin/pg_ctl/pg_ctl.c

index 3cb866f53069b12406eb1a8199fb0b4b2bc3a7da..5452ae139a21ce8deac4483bf6ba90de65289595 100644 (file)
@@ -9906,19 +9906,7 @@ CheckForStandbyTrigger(void)
                        fast_promote = false;
                }
 
-               /*
-                * 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")));
+               ereport(LOG, (errmsg("received promote request")));
 
                ResetPromoteTriggered();
                triggered = true;
@@ -9934,6 +9922,7 @@ CheckForStandbyTrigger(void)
                                (errmsg("trigger file found: %s", TriggerFile)));
                unlink(TriggerFile);
                triggered = true;
+               fast_promote = true;
                return true;
        }
        return false;
index a4e7922d687e2c67c5ed0898e3319ecb18c107c0..14365e60791c09f0efe0a332f5f852b513eb4fe0 100644 (file)
@@ -1107,13 +1107,12 @@ do_promote(void)
        }
 
        /*
-        * Use two different kinds of promotion file so we can understand
-        * the difference between smart and fast promotion.
+        * For 9.3 onwards, use fast promotion as the default option.
+        * 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);
-       else
-               snprintf(promote_file, MAXPGPATH, "%s/promote", pg_data);
+       snprintf(promote_file, MAXPGPATH, "%s/fast_promote", pg_data);
 
        if ((prmfile = fopen(promote_file, "w")) == NULL)
        {
@@ -1778,7 +1777,7 @@ do_help(void)
                         "                 [-o \"OPTIONS\"]\n"), progname);
        printf(_("  %s reload  [-D DATADIR] [-s]\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);
 #if defined(WIN32) || defined(__CYGWIN__)
        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(_("  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("  ABRT HUP INT QUIT TERM USR1 USR2\n");