Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C6F4FB5DBD1 for ; Fri, 23 Sep 2011 13:58:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 91929-07 for ; Fri, 23 Sep 2011 16:58:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from exprod7og108.obsmtp.com (exprod7og108.obsmtp.com [64.18.2.169]) by mail.postgresql.org (Postfix) with ESMTP id 94E23B5DC22 for ; Fri, 23 Sep 2011 13:58:35 -0300 (ADT) Received: from mail-bw0-f41.google.com ([209.85.214.41]) (using TLSv1) by exprod7ob108.postini.com ([64.18.6.12]) with SMTP ID DSNKTny6upnEdQLVM6BSnkY1vbzA/2UK1sJv@postini.com; Fri, 23 Sep 2011 09:58:35 PDT Received: by mail-bw0-f41.google.com with SMTP id zs2so4816051bkb.14 for ; Fri, 23 Sep 2011 09:58:34 -0700 (PDT) Received: by 10.204.129.130 with SMTP id o2mr2777832bks.397.1316797113970; Fri, 23 Sep 2011 09:58:33 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi. [88.195.122.240]) by mx.google.com with ESMTPS id x4sm2423865fad.1.2011.09.23.09.58.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Sep 2011 09:58:32 -0700 (PDT) Message-ID: <4E7CBAB6.6010205@enterprisedb.com> Date: Fri, 23 Sep 2011 19:58:30 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: Florian Pflug CC: Robert Haas , Aidan Van Dyk , Linas Virbalas , Euler Taveira de Oliveira , "pgsql-hackers@postgresql.org" Subject: Re: Hot Backup with rsync fails at pg_clog if under load References: <4E7C4638.1060103@enterprisedb.com> <9C1909AF-D319-49BF-B3DA-5C3C30B5C849@phlo.org> In-Reply-To: <9C1909AF-D319-49BF-B3DA-5C3C30B5C849@phlo.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/1233 X-Sequence-Number: 195422 On 23.09.2011 19:49, Florian Pflug wrote: > On Sep23, 2011, at 18:45 , Robert Haas wrote: >> Ah. I think you are right - Heikki made the same point. Maybe some >> of the stuff that happens just after this comment: >> >> /* >> * Initialize for Hot Standby, if enabled. We won't let backends in >> * yet, not until we've reached the min recovery point specified in >> * control file and we've established a recovery snapshot from a >> * running-xacts WAL record. >> */ >> >> >> ...actually needs to be postponed until after we've reached consistency? > > I came the the same conclusion. It seems the before we've reached consistency, > we shouldn't attempt to read anything because the data can be pretty arbitrarily > garbled. There are pretty clear rules on what state clog can be in. When you launch postmaster in a standby: * Any clog preceding the nextXid from the checkpoint record we start recovery from, must either be valid, or the clog file must be missing altogether (which can happen when it was vacuumed away while the backup in progress - if the clog is still needed at the end of backup it must not be missing, of course). * Any clog following nextXid can be garbled or missing. Recovery will overwrite any clog after nextXid from the WAL, but not the clog before it. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com