Disable pg_standby -l option because the backend doesn't expect the recovered
authorHeikki Linnakangas <heikki@enterprisedb.com>
Thu, 25 Jun 2009 12:03:11 +0000 (12:03 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Thu, 25 Jun 2009 12:03:11 +0000 (12:03 +0000)
file to be a symlink. We tried to fix this issue with an earlier server-side
patch, but it didn't fix the whole issue.

The same bug is present in older releases as well, but the 8.4 train is
about to leave the station, and I'm not sure if have consensus on whether
we can remove the -l option in back-branches or do we need to attempt a
server-side fix to make symlinking safe.

Patch by Simon Riggs, per discussion on bug identified by Fujii Masao.

contrib/pg_standby/pg_standby.c
doc/src/sgml/pgstandby.sgml

index 4460255376ea057eb1a9704931cb9e424efe3c8e..dcec49116bcaff02515ed5ddb0e7842ee8158a35 100644 (file)
@@ -523,7 +523,7 @@ usage(void)
        printf("  -d                 generate lots of debugging output (testing only)\n");
        printf("  -k NUMFILESTOKEEP  if RESTARTWALFILE not used, removes files prior to limit\n"
                   "                     (0 keeps all)\n");
-       printf("  -l                 links into archive (leaves file in archive)\n");
+       printf("  -l                 does nothing; use of link is now deprecated\n");
        printf("  -r MAXRETRIES      max number of times to retry, with progressive wait\n"
                   "                     (default=3)\n");
        printf("  -s SLEEPTIME       seconds to wait between file checks (min=1, max=60,\n"
@@ -610,7 +610,12 @@ main(int argc, char **argv)
                                }
                                break;
                        case 'l':                       /* Use link */
-                               restoreCommandType = RESTORE_COMMAND_LINK;
+                               /*
+                                * Link feature disabled, possibly permanently. Linking
+                                * causes a problem after recovery ends that is not currently
+                                * resolved by PostgreSQL. 25 Jun 2009
+                                       restoreCommandType = RESTORE_COMMAND_LINK;
+                               */
                                break;
                        case 'r':                       /* Retries */
                                maxretries = atoi(optarg);
index 5fae417f462d3ad065224ac6a9564d6d459f5915..a77620e1ec0c33f786f8c1246424cfe5c97f30ff 100644 (file)
   <application>pg_standby</application> features include:
  </para>
  <itemizedlist>
-  <listitem>
-   <para>
-    Supports copy or link for restoring WAL files
-   </para>
-  </listitem>
   <listitem>
    <para>
     Written in C, so very portable and easy to install
@@ -171,23 +166,11 @@ pg_standby <optional> <replaceable>option</> ... </optional> <replaceable>archiv
        archive space.
       </entry>
      </row>
-     <row>
-      <entry><literal>-l</></entry>
-      <entry>no</entry>
-      <entry>
-       Use <literal>ln</> command to restore WAL files from archive.
-       Link is more efficient than copy, but the default is copy since link
-       will not work in all scenarios.
-       On Windows, this option uses the <literal>mklink</> command
-       to provide a file-to-file symbolic link. <literal>-l</> will
-       not work on versions of Windows prior to Vista.
-      </entry>
-     </row>
      <row>
       <entry><literal>-r</> <replaceable>maxretries</></entry>
       <entry>3</entry>
       <entry>
-        Set the maximum number of times to retry the copy or link command if it
+        Set the maximum number of times to retry the copy command if it
         fails. After each failure, we wait for <replaceable>sleeptime</> *
         <replaceable>num_retries</>
         so that the wait time increases progressively.  So by default,
@@ -242,7 +225,7 @@ pg_standby <optional> <replaceable>option</> ... </optional> <replaceable>archiv
   <programlisting>
 archive_command = 'cp %p .../archive/%f'
 
-restore_command = 'pg_standby -l -d -s 2 -t /tmp/pgsql.trigger.5442 .../archive %f %p %r 2>>standby.log'
+restore_command = 'pg_standby -d -s 2 -t /tmp/pgsql.trigger.5442 .../archive %f %p %r 2>>standby.log'
 
 recovery_end_command = 'rm -f /tmp/pgsql.trigger.5442'
   </programlisting>
@@ -253,11 +236,6 @@ recovery_end_command = 'rm -f /tmp/pgsql.trigger.5442'
    This will:
   </para>
   <itemizedlist>
-   <listitem>
-    <para>
-     use the <literal>ln</> command to restore WAL files from archive
-    </para>
-   </listitem>
    <listitem>
     <para>
      produce debugging output in <filename>standby.log</>