Re: switch UNLOGGED to LOGGED

Alvaro Herrera <alvherre@commandprompt.com>

From: Alvaro Herrera <alvherre@commandprompt.com>
To: Leonardo Francalanci <m_lists@yahoo.it>
Cc: Robert Haas <robertmhaas@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-04-18T16:30:22Z
Lists: pgsql-hackers
Excerpts from Leonardo Francalanci's message of lun abr 18 09:36:13 -0300 2011:
> I think I coded a very basic version of the UNLOGGED to LOGGED patch
> (only wal_level=minimal case for the moment).
> 
> To remove the INIT fork, I changed somehow PendingRelDelete to have
> a flag "bool onlyInitFork" so that the delete would remove only the INIT
> fork at commit.
> 
> Everything "works" (note the quotes...) except in the case of not-clean
> shutdown ("-m immediate" to pg_ctl stop). The reason is that the replay
> code doesn't have any idea that it has to remove only the INIT fork: it will
> remove ALL forks; so at the end of the redo procedure (at startup, after
> a "pg_ctl -m immediate stop") the table doesn't have any forks at all.

Maybe you should change xl_act_commit to have a separate list of rels to
drop the init fork for (instead of mixing those with the list of files to
drop as a whole).

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support