Improve comment about why sleep is used by pg_standby to handle 'copy'
authorBruce Momjian <bruce@momjian.us>
Mon, 15 Dec 2008 22:13:02 +0000 (22:13 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 15 Dec 2008 22:13:02 +0000 (22:13 +0000)
file size problem.

contrib/pg_standby/pg_standby.c

index 1d4e291d3fdfb68df9b7f1adbee1b7f8ebd0e62e..96c5b829a80421c0cbf8fb52c9ae083002243814 100644 (file)
@@ -179,12 +179,11 @@ CustomizableNextWALFileReady()
 #ifdef WIN32
 
                        /*
-                        * Windows reports that the file has the right number of bytes
-                        * even though the file is still being copied and cannot be opened
-                        * by pg_standby yet. So we wait for sleeptime secs before
-                        * attempting to restore. If that is not enough, we will rely on
-                        * the retry/holdoff mechanism.  GNUWin32's cp does not have
-                        * this problem.
+                        * Windows 'cp' sets the final file size before the copy is
+                        * complete, and not yet ready to be opened by pg_standby.
+                        * So we wait for sleeptime secs before attempting to restore.
+                        * If that is not enough, we will rely on the retry/holdoff
+                        * mechanism.  GNUWin32's cp does not have this problem.
                         */
                        pg_usleep(sleeptime * 1000000L);
 #endif