On further reflection I've realized that there's a really unpleasant consequence of the walwriter change as-committed: it breaks the former guarantee that async commits would reach disk within at most 3 times the WalWriterDelay setting. They will still get written within at most 3 walwriter cycles, but a lone async commit occurring when the writer is hibernating could see a delay much longer than before. This seems to me to be unacceptable. Probably nobody cares that much about the exact multiplier of 3, but if the delay could be an order of magnitude or two more than that, that's going to make users of async commits unhappy.
So what we need here is for XLogSetAsyncXactLSN() to be able to boot the walwriter out of hibernate mode. I still don't care in the least for the original hack of using the state of the procLatch to indicate whether the walwriter is hibernating, but we can add a separate flag instead so as to avoid having every trip through XLogSetAsyncXactLSN do a SetLatch call (which would be bad anyway since it would prevent the walwriter from sleeping normally). Since XLogSetAsyncXactLSN has to take the info_lck anyway, we might as well make this new flag be protected by info_lck. The walwriter won't need to change the flag's state very often, by definition, so that end of it isn't going to cost anything noticeable. 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