Re: WAL logging problem in 9.4.3? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: WAL logging problem in 9.4.3?
Date
Msg-id 20150703164931.GI3291@awork2.anarazel.de
Whole thread Raw
In response to Re: WAL logging problem in 9.4.3?  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: WAL logging problem in 9.4.3?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
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.




pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: pgbench - allow backslash-continuations in custom scripts
Next
From: Tom Lane
Date:
Subject: Re: WAL logging problem in 9.4.3?