diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-11-16 11:02:11 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2010-11-16 11:32:21 +0200 |
commit | 2edc5cd493ce3d7834026970e9d3cd00e203f51a (patch) | |
tree | b688d8be9ade0364f35a4a5ebdb76406b528bcbd /src/backend/access/gist/gistvacuum.c | |
parent | add0ea88e7722b48d1f3a7c38e3cfd7f1e854674 (diff) | |
download | postgresql-2edc5cd493ce3d7834026970e9d3cd00e203f51a.tar.gz postgresql-2edc5cd493ce3d7834026970e9d3cd00e203f51a.zip |
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.
Diffstat (limited to 'src/backend/access/gist/gistvacuum.c')
-rw-r--r-- | src/backend/access/gist/gistvacuum.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c index 0ff5ba840ee..dbe9406ceb8 100644 --- a/src/backend/access/gist/gistvacuum.c +++ b/src/backend/access/gist/gistvacuum.c @@ -268,7 +268,7 @@ gistbulkdelete(PG_FUNCTION_ARGS) pfree(rdata); } else - PageSetLSN(page, XLogRecPtrForTemp); + PageSetLSN(page, GetXLogRecPtrForTemp()); END_CRIT_SECTION(); } |