Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 84C40B5DBC1 for ; Mon, 26 Sep 2011 17:39:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 42390-03 for ; Mon, 26 Sep 2011 20:39:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 64ACDB5DBCD for ; Mon, 26 Sep 2011 17:39:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8QKdGCB000890; Mon, 26 Sep 2011 16:39:16 -0400 (EDT) To: Simon Riggs cc: Fujii Masao , PostgreSQL-development Subject: Re: bug of recovery? In-reply-to: References: Comments: In-reply-to Simon Riggs message dated "Mon, 26 Sep 2011 20:06:41 +0100" Date: Mon, 26 Sep 2011 16:39:16 -0400 Message-ID: <889.1317069556@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/1421 X-Sequence-Number: 195610 Simon Riggs writes: > On Mon, Sep 26, 2011 at 10:50 AM, Fujii Masao wrote: >> To prevent the above problem, we should write the contents of the hash table to >> the disk for every restartpoints, I think. Then, when the server >> starts recovery, >> it should reload the hash table from the disk. Thought? Am I missing something? > That doesn't happen because the when we stop the server it will > restart from a valid restartpoint - one where there is no in-progress > multi-phase operation. Not clear that that's true. The larger point though is that the invalid-page table is only interesting during crash recovery --- once you've reached a consistent state, it should be empty and remain so. So I see no particular value in Fujii's proposal of logging the table to disk during standby mode. It might be worthwhile to invoke XLogCheckInvalidPages() as soon as we (think we) have reached consistency, rather than leaving it to be done only when we exit recovery mode. regards, tom lane