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:02 +0200 | 
| commit | 821bb177227be9287f8fd50c2398c7bc5c3929e3 (patch) | |
| tree | 8b52493d0fd23f6013b23c102093fe811d993852 /src/include/access/gist_private.h | |
| parent | e086197aaa8de484dafcb1cc991640980e252d70 (diff) | |
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/include/access/gist_private.h')
| -rw-r--r-- | src/include/access/gist_private.h | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index a85da662cec..4df5fed116b 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -87,7 +87,6 @@ typedef struct GISTScanOpaqueData  typedef GISTScanOpaqueData *GISTScanOpaque;  /* XLog stuff */ -extern const XLogRecPtr XLogRecPtrForTemp;  #define XLOG_GIST_PAGE_UPDATE		0x00  #define XLOG_GIST_NEW_ROOT			0x20 @@ -326,6 +325,8 @@ extern void gistMakeUnionKey(GISTSTATE *giststate, int attno,  				 GISTENTRY *entry2, bool isnull2,  				 Datum *dst, bool *dstisnull); +extern XLogRecPtr GetXLogRecPtrForTemp(void); +  /* gistvacuum.c */  extern Datum gistbulkdelete(PG_FUNCTION_ARGS);  extern Datum gistvacuumcleanup(PG_FUNCTION_ARGS); | 
