Skip site navigation (1) Skip section navigation (2)

pgsql: Remove extra copies of LogwrtResult.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove extra copies of LogwrtResult.
Date: 2012-03-06 08:18:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committerspgsql-hackers
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.



Modified Files
src/backend/access/transam/xlog.c |   74 +++++++++++--------------------------
1 files changed, 22 insertions(+), 52 deletions(-)


pgsql-hackers by date

Next:From: Simon RiggsDate: 2012-03-06 08:44:38
Subject: Re: Checksums, state of play
Previous:From: Marko KreenDate: 2012-03-06 08:13:31
Subject: Re: Speed dblink using alternate libpq tuple storage

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2012-03-06 08:47:34
Subject: pgsql: Make the comments more clear on the fact thatUpdateFullPageWrit
Previous:From: Bruce MomjianDate: 2012-03-06 02:20:08
Subject: pgsql: In pg_upgrade, only lock the old cluster if link mode is used,a

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group