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 3FC9BEAE486 for ; Fri, 22 Oct 2004 21:50:48 +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 62565-02 for ; Fri, 22 Oct 2004 20:50:48 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 06C49EAE46B for ; Fri, 22 Oct 2004 21:50:40 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i9MKolJB062812 for ; Fri, 22 Oct 2004 20:50:48 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i9MKoRHh062731 for pgsql-admin@postgresql.org; Fri, 22 Oct 2004 20:50:27 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.admin Subject: Re: replication using WAL archives Date: Fri, 22 Oct 2004 22:50:34 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 39 Message-ID: <4179729A.5020401@bigfoot.com> References: <002801c4b739$68450870$7201a8c0@mst1x5r347kymb> <1098384082.15573.14.camel@camel> <41782EEF.5040708@bigfoot.com> <011a01c4b818$b7370a20$06e887d9@Nightingale> <4179390B.10700@bigfoot.com> <1098466150.20926.13.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@pyrenet.fr To: Simon Riggs User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en In-Reply-To: <1098466150.20926.13.camel@localhost.localdomain> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-admin@postgresql.org 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/313 X-Sequence-Number: 15306 Simon Riggs wrote: > Situation I thought I saw was: > > - copy away current partial filled xlog N > - xlog N fills, N+1 starts > - xlog N+1 fills, N+2 starts > - copy away current partial filled xlog: N+2 (+10 secs later) > > i.e. if time to fill xlog (is ever) < time to copy away current xlog, > then you miss one. > > So problem: you can miss one and never know you've missed one until the > recovery can't find it, which it never returns from...so it just hangs. No. The restore.sh is not smart enough to know the last wal that must be replayed, the only "smart thing" is to copy the supposed "current wal" in the archive directory. The script hang (and is a feature not a bug) if and only if the master is alive ( at least I'm not seeing any other hang ). In your example in the archived directory will be present the files until logN and logN+2 ( the current wal ) is in the partial directory, if the master die, the restore.sh will copy logN+2 in the archived directory, the spare node will execute restore.sh with file logN+1 as argument and if is not found then the restore.sh will exit. Regards Gaetano Mendola