]> granicus.if.org Git - postgresql/commit
Remove extra copies of LogwrtResult.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 6 Mar 2012 07:34:10 +0000 (09:34 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 6 Mar 2012 08:18:33 +0000 (10:18 +0200)
commit7714c6382941383514c0f1954ca831686ac4fcd2
tree466251839b4c945da57131d9ede5d36bf6126584
parent3b682df3260aa8e020201e4b6c5cbc31fe8ecb8e
Remove extra copies of LogwrtResult.

This simplifies the code a little bit. The new rule is that to update
XLogCtl->LogwrtResult, you must hold both WALWriteLock and info_lck, whereas
before we had two copies, one that was protected by WALWriteLock and another
protected by info_lck. The code that updates them was already holding both
locks, so merging the two is trivial.

The third copy, XLogCtl->Insert.LogwrtResult, was not totally redundant, it
was used in AdvanceXLInsertBuffer to update the backend-local copy, before
acquiring the info_lck to read the up-to-date value. But the value of that
seems dubious; at best it's saving one spinlock acquisition per completed
WAL page, which is not significant compared to all the other work involved.
And in practice, it's probably not saving even that much.
src/backend/access/transam/xlog.c