Guido Ostkamp <postgresql@xxxxxxxxxxxxxxxxxxx> writes: > Would this work or is there a special reason why the original check was > done with lock held? This will fail, very nastily, on multiple-CPU machines with weak memory ordering guarantees. You can't assume you are seeing an up-to-date value of the flag bit if you don't take the spinlock first. There are places where we can get away with such things because a slightly stale answer is okay, but not in BufferSync(). Failing to include a dirty page in the checkpoint is fatal. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general