Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZB4BX-0003Ln-SB for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jul 2015 16:51:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZB4BW-00016l-NU for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jul 2015 16:51:30 +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 1ZB49j-00081T-5R for pgsql-hackers@postgresql.org; Fri, 03 Jul 2015 16:49:39 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZB49f-0006mt-L5 for pgsql-hackers@postgresql.org; Fri, 03 Jul 2015 16:49:38 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 2E8C3860002; Fri, 3 Jul 2015 18:49:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-6.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC66C2.dip0.t-ipconnect.de [93.220.102.194]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id E3996860001; Fri, 3 Jul 2015 18:49:31 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 52ED3102215; Fri, 3 Jul 2015 18:49:31 +0200 (CEST) Date: Fri, 3 Jul 2015 18:49:31 +0200 From: Andres Freund To: Fujii Masao Cc: Tom Lane , Martijn van Oosterhout , PostgreSQL-development Subject: Re: WAL logging problem in 9.4.3? Message-ID: <20150703164931.GI3291@awork2.anarazel.de> References: <20150702220524.GA9392@svana.org> <20150702222102.GG30708@awork2.anarazel.de> <20150703052048.GA20285@svana.org> <20150703060137.GB20285@svana.org> <28320.1435935120@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.8 (----) 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 On 2015-07-04 01:39:42 +0900, Fujii Masao wrote: > 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. > > Then how should we implement that? Invent new WAL record type that > calls smgrtruncate() and index_build() during WAL replay? Or add the > special flag to XLOG_SMGR_TRUNCATE record, and make WAL replay > call index_build() only if the flag is found? Any other good idea? > Anyway ISTM that we might need to add or modify WAL record. It's easy enough to log something like a metapage with log_newpage(). But the more interesting question is why that's not hhappening today. RelationTruncateIndexes() does call the index_build() which should end up WAL logging the index creation. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers