Excerpts from Tom Lane's message of jue ago 05 11:06:57 -0400 2010:
> Seems like we need to think harder about recovering from a truncate
> failure. A few random ideas:
Ugh.
> 1. Write the dirty buffers before dropping them. Kind of ugly from a
> performance viewpoint, but simple and safe.
I think "simple" is good, considering that this code is gone in 9.0 and
HEAD. IMHO investing too much effort on this problem is not worth it.
Perhaps it'd be good to come up with a better solution for HEAD:
> 3. Don't discard the dirty buffers until after successfully truncating.
> The hard part here is to be sure no other process (like bgwriter) will
> try to write them in between. I don't see a way to guarantee that,
> at least not without interlock infrastructure that doesn't exist today.
--
Ãlvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support