[PATCHES] pg_standby remove unsupported switch u
Hello this patch removes unsupported switch u from description for command. Regards Pavel Stehule *** ./contrib/pg_standby/pg_standby.c.orig 2007-05-22 15:47:42.0 +0200 --- ./contrib/pg_standby/pg_standby.c 2007-05-22 15:48:10.0 +0200 *** *** 379,385 fprintf(stderr, note space between [ARCHIVELOCATION] and [NEXTWALFILE]\n); fprintf(stderr, with main intended use via restore_command in the recovery.conf\n); fprintf(stderr, restore_command = 'pg_standby [OPTION]... [ARCHIVELOCATION] %%f %%p'\n); ! fprintf(stderr, e.g. restore_command = 'pg_standby -l -u /mnt/server/archiverdir %%f %%p'\n); fprintf(stderr, \nOptions:\n); fprintf(stderr, -c copies file from archive (default)\n); fprintf(stderr, -d generate lots of debugging output (testing only)\n); --- 379,385 fprintf(stderr, note space between [ARCHIVELOCATION] and [NEXTWALFILE]\n); fprintf(stderr, with main intended use via restore_command in the recovery.conf\n); fprintf(stderr, restore_command = 'pg_standby [OPTION]... [ARCHIVELOCATION] %%f %%p'\n); ! fprintf(stderr, e.g. restore_command = 'pg_standby -l /mnt/server/archiverdir %%f %%p'\n); fprintf(stderr, \nOptions:\n); fprintf(stderr, -c copies file from archive (default)\n); fprintf(stderr, -d generate lots of debugging output (testing only)\n); ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [PATCHES] pg_standby remove unsupported switch u
Pavel Stehule escribió: Hello this patch removes unsupported switch u from description for command. Applied, thanks. I noticed that the usage section is not very uniform and could well use a cleanup, but I'm not doing it at this time. -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [PATCHES] pg_standby Error cleanup
Patch applied. Thanks. --- Darcy Buskermolen wrote: Please find attached a patch which provides for logging in the event that -k is unable to clean up an old WAL file. Also make the failed to remove file error message consistant for the trigger file. -- Darcy Buskermolen Command Prompt, Inc. Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 PostgreSQL solutions since 1997 http://www.commandprompt.com/ [ Attachment, skipping... ] ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- Bruce Momjian [EMAIL PROTECTED] http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [PATCHES] pg_standby Error cleanup
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. --- Darcy Buskermolen wrote: Please find attached a patch which provides for logging in the event that -k is unable to clean up an old WAL file. Also make the failed to remove file error message consistant for the trigger file. -- Darcy Buskermolen Command Prompt, Inc. Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 PostgreSQL solutions since 1997 http://www.commandprompt.com/ [ Attachment, skipping... ] ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- Bruce Momjian [EMAIL PROTECTED] http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[PATCHES] pg_standby Error cleanup
Please find attached a patch which provides for logging in the event that -k is unable to clean up an old WAL file. Also make the failed to remove file error message consistant for the trigger file. -- Darcy Buskermolen Command Prompt, Inc. Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 PostgreSQL solutions since 1997 http://www.commandprompt.com/ ? pg_standby.c.patch Index: pg_standby.c === RCS file: /projects/cvsroot/pgsql/contrib/pg_standby/pg_standby.c,v retrieving revision 1.2 diff -u -c -r1.2 pg_standby.c *** pg_standby.c 10 Feb 2007 19:52:45 - 1.2 --- pg_standby.c 20 Feb 2007 19:58:04 - *** *** 264,273 #else snprintf(WALFilePath, MAXPGPATH, %s/%s, archiveLocation, xlde-d_name); #endif - rc = unlink(WALFilePath); if (debug) ! fprintf(stderr, \npg_standby: removed \%s\\n, WALFilePath); } } } --- 264,278 #else snprintf(WALFilePath, MAXPGPATH, %s/%s, archiveLocation, xlde-d_name); #endif if (debug) ! fprintf(stderr, \npg_standby: removing \%s\\n, WALFilePath); ! ! rc = unlink(WALFilePath); ! if (rc !=0 ) ! fprintf(stderr, \npg_standby: ERROR failed to remove \%s\ because %s\n, WALFilePath, strerror(errno)); ! ! } } } *** *** 315,321 rc = unlink(triggerPath); if (rc != 0) { ! fprintf(stderr, \n ERROR: unable to remove \%s\, rc=%d, triggerPath, rc); fflush(stderr); exit(rc); } --- 320,326 rc = unlink(triggerPath); if (rc != 0) { ! fprintf(stderr, \n ERROR: unable to remove \%s\, because %s, triggerPath, strerror(errno)); fflush(stderr); exit(rc); } ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [pgsql-patches] [PATCHES] pg_standby
At the risk of starting trouble, is there some reason this was added to contrib and not put on pgfoundry ? On Thursday 08 February 2007 10:09, Bruce Momjian wrote: Patch applied. Thanks. --- Simon Riggs wrote: On Wed, 2007-01-17 at 16:15 +, Simon Riggs wrote: On Wed, 2007-01-17 at 10:05 -0500, Merlin Moncure wrote: On 12/28/06, Simon Riggs [EMAIL PROTECTED] wrote: On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. I double checked and re-ran all my test and confirmed that pg_standby move (-m) mode is definitely busted in v3 in the sense that a restart of the standby will not resume recovery and requires a pg_resetxlog to become operational -- it needs one more WAL file back than the oldest one available. new v4 Changes - removed -m command, design flaw in original spec, use -l instead - added -k N command to cleanup archive and leave max N files - fflush() points added to allow Windows debug - bug fix: when .history file present - bug fix: command line switch cleanup - readme updated new v6 (v5 was Windows dev release) Changes - added -r option to specify maxretries - -l option for Windows Vista (only) using mklink - Windows examples and docs added to readme - code restructured to allow more easy customization - bug fix: -k 0 error fixed - successful port report from Dave Page on Windows XP -- Simon Riggs EnterpriseDB http://www.enterprisedb.com [ Attachment, skipping... ] ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly -- Robert Treat Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [pgsql-patches] [PATCHES] pg_standby
Patch applied. Thanks. --- Simon Riggs wrote: On Wed, 2007-01-17 at 16:15 +, Simon Riggs wrote: On Wed, 2007-01-17 at 10:05 -0500, Merlin Moncure wrote: On 12/28/06, Simon Riggs [EMAIL PROTECTED] wrote: On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. I double checked and re-ran all my test and confirmed that pg_standby move (-m) mode is definitely busted in v3 in the sense that a restart of the standby will not resume recovery and requires a pg_resetxlog to become operational -- it needs one more WAL file back than the oldest one available. new v4 Changes - removed -m command, design flaw in original spec, use -l instead - added -k N command to cleanup archive and leave max N files - fflush() points added to allow Windows debug - bug fix: when .history file present - bug fix: command line switch cleanup - readme updated new v6 (v5 was Windows dev release) Changes - added -r option to specify maxretries - -l option for Windows Vista (only) using mklink - Windows examples and docs added to readme - code restructured to allow more easy customization - bug fix: -k 0 error fixed - successful port report from Dave Page on Windows XP -- Simon Riggs EnterpriseDB http://www.enterprisedb.com [ Attachment, skipping... ] ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly -- Bruce Momjian [EMAIL PROTECTED] http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [PATCHES] pg_standby
On Thu, 2007-02-01 at 15:14 -0500, Doug Knight wrote: Quick question on the -w option; setting it to zero disables, do you mean it waits until the file appears or a trigger file appears, or it just doesn't wait at all? It means it waits forever, or until a trigger file appears - but a trigger file is optional, so its possible to create an awkward situation. I'm not happy with that default, but feedback from Merlin suggested production problems with people not understanding that. I'm happy to change to whatever consensus is, so if you think that's dumb, just shout. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [PATCHES] pg_standby
Not at all, in fact I was planning on using the infinite wait, and using something like heartbeat to force creation of the trigger file in the event the primary dies. Thanks Simon! Doug On Fri, 2007-02-02 at 14:38 +, Simon Riggs wrote: On Thu, 2007-02-01 at 15:14 -0500, Doug Knight wrote: Quick question on the -w option; setting it to zero disables, do you mean it waits until the file appears or a trigger file appears, or it just doesn't wait at all? It means it waits forever, or until a trigger file appears - but a trigger file is optional, so its possible to create an awkward situation. I'm not happy with that default, but feedback from Merlin suggested production problems with people not understanding that. I'm happy to change to whatever consensus is, so if you think that's dumb, just shout.
Re: [PATCHES] pg_standby
Hi Simon, Quick question on the -w option; setting it to zero disables, do you mean it waits until the file appears or a trigger file appears, or it just doesn't wait at all? Doug Knight WSI Inc Andover, MA On Mon, 2007-01-22 at 13:06 +, Simon Riggs wrote: On Wed, 2007-01-17 at 16:15 +, Simon Riggs wrote: On Wed, 2007-01-17 at 10:05 -0500, Merlin Moncure wrote: On 12/28/06, Simon Riggs [EMAIL PROTECTED] wrote: On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. I double checked and re-ran all my test and confirmed that pg_standby move (-m) mode is definitely busted in v3 in the sense that a restart of the standby will not resume recovery and requires a pg_resetxlog to become operational -- it needs one more WAL file back than the oldest one available. new v4 Changes - removed -m command, design flaw in original spec, use -l instead - added -k N command to cleanup archive and leave max N files - fflush() points added to allow Windows debug - bug fix: when .history file present - bug fix: command line switch cleanup - readme updated new v6 (v5 was Windows dev release) Changes - added -r option to specify maxretries - -l option for Windows Vista (only) using mklink - Windows examples and docs added to readme - code restructured to allow more easy customization - bug fix: -k 0 error fixed - successful port report from Dave Page on Windows XP
Re: [pgsql-patches] [PATCHES] pg_standby
On Wed, 2007-01-17 at 16:15 +, Simon Riggs wrote: On Wed, 2007-01-17 at 10:05 -0500, Merlin Moncure wrote: On 12/28/06, Simon Riggs [EMAIL PROTECTED] wrote: On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. I double checked and re-ran all my test and confirmed that pg_standby move (-m) mode is definitely busted in v3 in the sense that a restart of the standby will not resume recovery and requires a pg_resetxlog to become operational -- it needs one more WAL file back than the oldest one available. new v4 Changes - removed -m command, design flaw in original spec, use -l instead - added -k N command to cleanup archive and leave max N files - fflush() points added to allow Windows debug - bug fix: when .history file present - bug fix: command line switch cleanup - readme updated new v6 (v5 was Windows dev release) Changes - added -r option to specify maxretries - -l option for Windows Vista (only) using mklink - Windows examples and docs added to readme - code restructured to allow more easy customization - bug fix: -k 0 error fixed - successful port report from Dave Page on Windows XP -- Simon Riggs EnterpriseDB http://www.enterprisedb.com pg_standby.v6.tar Description: Unix tar archive ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [pgsql-patches] [PATCHES] pg_standby
On 12/28/06, Simon Riggs [EMAIL PROTECTED] wrote: On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. I double checked and re-ran all my test and confirmed that pg_standby move (-m) mode is definitely busted in v3 in the sense that a restart of the standby will not resume recovery and requires a pg_resetxlog to become operational -- it needs one more WAL file back than the oldest one available. I am currently working around this by rotating WAL files a couple of versions back in the shell script I am using to receive log files via netcat. move mode is very desirable because it keeps the maintenance down for the standby system. merlin ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [pgsql-patches] [PATCHES] pg_standby
I confirm that I am seeing the exact same characteristic. Could you post your rotating script? Thanks, Doug On Wed, 2007-01-17 at 10:05 -0500, Merlin Moncure wrote: On 12/28/06, Simon Riggs [EMAIL PROTECTED] wrote: On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. I double checked and re-ran all my test and confirmed that pg_standby move (-m) mode is definitely busted in v3 in the sense that a restart of the standby will not resume recovery and requires a pg_resetxlog to become operational -- it needs one more WAL file back than the oldest one available. I am currently working around this by rotating WAL files a couple of versions back in the shell script I am using to receive log files via netcat. move mode is very desirable because it keeps the maintenance down for the standby system. merlin
Re: [pgsql-patches] [PATCHES] pg_standby
On 1/17/07, Doug Knight [EMAIL PROTECTED] wrote: I confirm that I am seeing the exact same characteristic. Could you post your rotating script? note: this is still a work in progress, the crude but effective sleep 5 is due to be replaced with a lock/fifo and there catch_wal.sh needs to be rewritten a bit. truncate is a C one-liner I wrote which does a ftruncate. *** primary: *** archive_command = '/home/postgres/send_wal.sh %p %f' *** send_wal.sh: *** !/bin/bash echo archiving: $2 ~/send_wal.log cat $1 (echo placeholder) (echo $2) | nc $STANDBY 1234 sleep 5 *** secondary: *** restore_command = 'pg_standby -m -w0 -t/raid/pitr/kill /raid/pitr %f %p' *** catch_wal.sh *** !/bin/bash WALDIR=/raid/pitr rm -f $WALDIR/*.old rm -f $WALDIR/*.older $WALDIR/tmp.older $WALDIR/tmp.old while true; do tmpfile=`mktemp` nc -l 1234 $tmpfile || { echo FATAL: nc listen failed; exit 1; } chown postgres:postgres $tmpfile file_name=`tail -1 $tmpfile` ./truncate $tmpfile 16777216 rm -f $WALDIR/*.older for i in `ls $WALDIR/*.old`; do mv $i $WALDIR/`basename $i .old`.older; done mv $tmpfile $WALDIR/$file_name.old cp --preserve=ownership $WALDIR/$file_name.old $WALDIR/$file_name echo LOG: caught file: $file_name done ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [pgsql-patches] [PATCHES] pg_standby
On 1/17/07, Merlin Moncure [EMAIL PROTECTED] wrote: On 1/17/07, Doug Knight [EMAIL PROTECTED] wrote: I confirm that I am seeing the exact same characteristic. Could you post your rotating script? note: this is still a work in progress, the crude but effective sleep 5 is due to be replaced with a lock/fifo and there catch_wal.sh needs to be rewritten a bit. truncate is a C one-liner I wrote which does a ftruncate. this turned out not to fix the problem...working on it still! merlin ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [pgsql-patches] [PATCHES] pg_standby
On 1/17/07, Simon Riggs [EMAIL PROTECTED] wrote: new v4 Changes - removed -m command, design flaw in original spec, use -l instead - added -k N command to cleanup archive and leave max N files - fflush() points added to allow Windows debug - bug fix: when .history file present - bug fix: command line switch cleanup - readme updated works fantastic. grazi...i guess my rotation would have worked with more files but -k is much cleaner. merlin ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [PATCHES] pg_standby
On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com pg_standby.v2.tar Description: Unix tar archive ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [PATCHES] pg_standby
On Thu, 2006-12-28 at 19:26 +, Simon Riggs wrote: On Thu, 2006-12-14 at 12:04 +, Simon Riggs wrote: pg_standby and test framework, in separate .tar files New version (v2), following further testing. Signal handling not included in this version. Signal handling now added, tested and working correctly in version 3, attached. pg_standby is an example program for a warm standby script as discussed on -hackers: http://archives.postgresql.org/pgsql-hackers/2006-08/msg00407.php Program looks complete and ready for review, to me. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com pg_standby.v3.tar Description: Unix tar archive ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster