diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-11-22 12:53:59 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-11-22 13:07:23 +0200 |
commit | 1a3d104475ce01326fc00601ed66ac4d658e37e5 (patch) | |
tree | e20102123012e30c84b9d1be83f184f62c505742 /src/backend/access/transam/clog.c | |
parent | f4482a542c30034c7871fd35050128823ef5c6d5 (diff) | |
download | postgresql-1a3d104475ce01326fc00601ed66ac4d658e37e5.tar.gz postgresql-1a3d104475ce01326fc00601ed66ac4d658e37e5.zip |
Avoid acquiring spinlock when checking if recovery has finished, for speed.
RecoveryIsInProgress() can be called very frequently. During normal
operation, it just checks a backend-local variable and returns quickly,
but during hot standby, it checks a spinlock-protected shared variable.
Those spinlock acquisitions can become a point of contention on a busy
hot standby system.
Replace the spinlock acquisition with a memory barrier.
Per discussion with Andres Freund, Ants Aasma and Merlin Moncure.
Diffstat (limited to 'src/backend/access/transam/clog.c')
0 files changed, 0 insertions, 0 deletions