X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5DB98EAEDBE for ; Fri, 22 Oct 2004 17:45:13 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82473-08 for ; Fri, 22 Oct 2004 16:45:11 +0000 (GMT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id E49F0EAEDB5 for ; Fri, 22 Oct 2004 17:45:00 +0100 (BST) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id i9MGh0U26124; Fri, 22 Oct 2004 18:43:01 +0200 Received: from [127.0.0.1] (accesspoint.mm.eutelsat.org [194.214.173.4]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id i9MGj5f09681; Fri, 22 Oct 2004 18:45:05 +0200 Message-ID: <4179390B.10700@bigfoot.com> Date: Fri, 22 Oct 2004 18:44:59 +0200 From: Gaetano Mendola User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Simon Riggs Cc: Robert Treat , pgsql-admin@postgresql.org, iain@mst.co.jp Subject: Re: replication using WAL archives References: <002801c4b739$68450870$7201a8c0@mst1x5r347kymb> <1098384082.15573.14.camel@camel> <41782EEF.5040708@bigfoot.com> <011a01c4b818$b7370a20$06e887d9@Nightingale> In-Reply-To: <011a01c4b818$b7370a20$06e887d9@Nightingale> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/309 X-Sequence-Number: 15302 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Simon Riggs wrote: |>Gaetano Mendola wrote |>Postgres can help this process, as suggested by Tom creating a | | pg_current_wal() | |>or even better having two new GUC parameters: archive_current_wal_command | | and | |>archive_current_wal_delay. | | | OK, we can modify the archiver to do this as well as the archive-when-full | functionality. I'd already agreed to do something similar for 8.1 | | PROPOSAL: | By default, archive_max_delay would be 10 seconds. | By default, archive_current_wal_command is not set. | If archive_current_wal_command is not set, the archiver will archive a file | using archive_command only when the file is full. | If archive_current_wal_command is set, the archiver would archive a file | whichever of these occurs first... | - it is full | - the archive_max_delay timeout occurs (default: disabled) | ...as you can see I've renamed archive_current_wal_delay to reflect the fact | that there is an interaction between the current mechanism (only when full) | and this additional mechanism (no longer than X secs between log files). | With that design, if the logs are being created quickly enough, then a | partial log file is never created, only full ones. | | When an xlog file is archived because it is full, then it is sent to both | archive_current_wal_command and archive_command (in that order). When the | timeout occurs and we have a partial xlog file, it would only be sent to | archive_current_wal_command. It may also be desirable to not use | archive_command at all, only to use archive_current_wal_command. That's not | currently possible because archive_command is the switch by which all of the | archive functioanlity is enabled, so you can't actually turn this off. It seems good to me, the script behind archive command can be a nop if someone want use the archive_current_wal_command | = - = - = | | Gaetano - skim-reading your script, how do you handle the situation when a | new xlog file has been written within 10 seconds? That way the current file | number will have jumped by 2, so when your script looks for the "Last wal" | using head -1 it will find the N+2 and the intermediate file will never be | copied. Looks like a problem to me... Yes, the only window failure I seen ( but I don't know if it's possible ) Master: ~ log N created log N filled archive log N log N+1 created log N+1 filled ~ log N+2 created ~ <---- the master die here before to archive the log N+1 ~ archive log N+1 in this case as you underline tha last log archived is the N and the N+2 partial wal is added to archived wal collection and in the recovery fase the recovery stop after processing the log N. Is it possible that the postmaster create the N+2 file without finish to archive the N+1 ? ( I suspect yes :-( ) The only cure I see here is to look for not archived WAL ( if possible ). |>I problem I discover during the tests is that if you shut down the spare |>node and the restore_command is still waiting for a file then the postmaster |>will never exit :-( | | | Hmm....Are you reporting this as a bug for 8.0? It's not on the bug list... For me is a behave to avoid. Regards Gaetano Mendola -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBeTkJ7UpzwH2SGd4RAsMxAKCbV7W+wrGBocf2Ftlthm0egAlIWACgp87L KU/YusyHuvT7jSFwZVKpP3M= =rWZx -----END PGP SIGNATURE-----