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

pgsql: The GiST scan algorithm uses LSNs to detect concurrent pagesspl

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: The GiST scan algorithm uses LSNs to detect concurrent pagesspl
Date: 2010-11-16 09:42:36
Message-ID: E1PII3g-0002Z0-JH@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
The GiST scan algorithm uses LSNs to detect concurrent pages splits, but
temporary indexes are not WAL-logged. We used a constant LSN for temporary
indexes, on the assumption that we don't need to worry about concurrent page
splits in temporary indexes because they're only visible to the current
session. But that assumption is wrong, it's possible to insert rows and
split pages in the same session, while a scan is in progress. For example,
by opening a cursor and fetching some rows, and INSERTing new rows before
fetching some more.

Fix by generating fake increasing LSNs, used in place of real LSNs in
temporary GiST indexes.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=7ff02add837eb34354ca7197e521da3260aef9c1

Modified Files
--------------
src/backend/access/gist/gist.c       |   10 ++++------
src/backend/access/gist/gistutil.c   |   21 +++++++++++++++++++++
src/backend/access/gist/gistvacuum.c |    8 ++++----
src/include/access/gist_private.h    |    3 ++-
4 files changed, 31 insertions(+), 11 deletions(-)

pgsql-committers by date

Next:From: Magnus HaganderDate: 2010-11-16 11:45:12
Subject: pgsql: Send paramHandle to subprocesses as 64-bit on Win64
Previous:From: User MaosenDate: 2010-11-16 08:29:24
Subject: pgexternaltable - src:

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