Alvaro Herrera <alvhe...@2ndquadrant.com> writes: > I suppose your hook idea lets you implement the LSN fork in an > extension, rather than having it be part of core. The idea of hooking > onto BufferSync makes me uneasy, though -- like it's not the correct > place to do it.
Yeah. Keep in mind that if the extension does anything at all that could possibly throw an error, and if that error condition persists across multiple tries, you will have broken the database completely: it will be impossible to complete a checkpoint, and your WAL segment pool will grow until it exhausts disk. So the idea of doing something that involves unspecified extension behavior, especially possible interaction with an external backup agent, right there is pretty terrifying. Other problems with the proposed patch: it misses coverage of BgBufferSync, and I don't like exposing an ad-hoc structure like CkptTsStatus as part of an extension API. The algorithm used by BufferSync to schedule buffer writes has changed multiple times before and doubtless will again; if we're going to have a hook here it should depend as little as possible on those details. 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