Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZB4E1-0003QY-QS for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jul 2015 16:54:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZB4E1-0001Sw-BT for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jul 2015 16:54:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZB4E0-0001Sp-4j for pgsql-hackers@postgresql.org; Fri, 03 Jul 2015 16:54:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZB4Dw-0006sk-KL for pgsql-hackers@postgresql.org; Fri, 03 Jul 2015 16:54:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t63Gru9c010147; Fri, 3 Jul 2015 12:53:56 -0400 From: Tom Lane To: Fujii Masao cc: Martijn van Oosterhout , Andres Freund , PostgreSQL-development Subject: Re: WAL logging problem in 9.4.3? In-reply-to: References: <20150702220524.GA9392@svana.org> <20150702222102.GG30708@awork2.anarazel.de> <20150703052048.GA20285@svana.org> <20150703060137.GB20285@svana.org> <28320.1435935120@sss.pgh.pa.us> Comments: In-reply-to Fujii Masao message dated "Sat, 04 Jul 2015 01:39:42 +0900" Date: Fri, 03 Jul 2015 12:53:56 -0400 Message-ID: <10146.1435942436@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Fujii Masao writes: > Okay, so probably we need to change WAL replay of TRUNCATE so that > the index file is truncated to one containing only meta page instead of > empty one. That is, the WAL replay of TRUNCATE would need to call > index_build() after smgrtruncate() maybe. That seems completely unworkable. For one thing, index_build would expect to be able to do catalog lookups, but we can't assume that the catalogs are in a good state yet. I think the responsibility has to be on the WAL-writing end to emit WAL instructions that lead to a correct on-disk state. Putting complex behavior into the reading side is fundamentally misguided. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers