mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Make GiST indexes on-disk compatible with 9.2 again.
The patch that turned XLogRecPtr into a uint64 inadvertently changed the on-disk format of GiST indexes, because the NSN field in the GiST page opaque is an XLogRecPtr. That breaks pg_upgrade. Revert the format of that field back to the two-field struct that XLogRecPtr was before. This is the same we did to LSNs in the page header to avoid changing on-disk format. Bump catversion, as this invalidates any existing GiST indexes built on 9.3devel.
This commit is contained in:
@ -66,7 +66,7 @@ gistRedoClearFollowRight(XLogRecPtr lsn, XLogRecord *record, int block_index,
|
||||
*/
|
||||
if (lsn >= PageGetLSN(page))
|
||||
{
|
||||
GistPageGetOpaque(page)->nsn = lsn;
|
||||
GistPageSetNSN(page, lsn);
|
||||
GistClearFollowRight(page);
|
||||
|
||||
PageSetLSN(page, lsn);
|
||||
@ -271,7 +271,7 @@ gistRedoPageSplitRecord(XLogRecPtr lsn, XLogRecord *record)
|
||||
if (newpage->header->blkno == GIST_ROOT_BLKNO)
|
||||
{
|
||||
GistPageGetOpaque(page)->rightlink = InvalidBlockNumber;
|
||||
GistPageGetOpaque(page)->nsn = xldata->orignsn;
|
||||
GistPageSetNSN(page, xldata->orignsn);
|
||||
GistClearFollowRight(page);
|
||||
}
|
||||
else
|
||||
@ -280,7 +280,7 @@ gistRedoPageSplitRecord(XLogRecPtr lsn, XLogRecord *record)
|
||||
GistPageGetOpaque(page)->rightlink = xlrec.page[i + 1].header->blkno;
|
||||
else
|
||||
GistPageGetOpaque(page)->rightlink = xldata->origrlink;
|
||||
GistPageGetOpaque(page)->nsn = xldata->orignsn;
|
||||
GistPageSetNSN(page, xldata->orignsn);
|
||||
if (i < xlrec.data->npage - 1 && !isrootsplit &&
|
||||
xldata->markfollowright)
|
||||
GistMarkFollowRight(page);
|
||||
|
Reference in New Issue
Block a user