On 2014-01-17 09:04:54 -0500, Robert Haas wrote: > That having been said, I bet it could be done at the tail of > XLogInsert(). if there are cases where that's not desirable, then add > macros HOLDOFF_WAL_THROTTLING() and RESUME_WAL_THROTTLING() that bump > a counter up and down. When the counter is >0, XLogInsert() doesn't > sleep; when RESUME_WAL_THROTTLING() drops the counter to 0, it also > considers sleeping. I suspect only a few places would need to do > this, like where we're holding one of the SLRU locks.
I don't think there are many locations where this would be ok. Sleeping while holding exclusive buffer locks? Quite possibly inside a criticial section? Surely not. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers