Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit47fe4d2

Browse files
committed
Initialize GIN metapage correctly when replaying metapage-update WAL record.
I broke this with my WAL format refactoring patch. Before that, the metapagewas read from disk, and modified in-place regardless of the LSN. That wasalways a bit silly, as there's no need to read the old page version fromdisk disk when we're overwriting it anyway. So that was changed in 9.5, butI failed to add a GinInitPage call to initialize the page-headers correctly.Usually you wouldn't notice, because the metapage is already in the pagecache and is not zeroed.One way to reproduce this is to perform a VACUUM on an already vacuumedtable (so that the vacuum has no real work to do), immediately after acheckpoint, and then perform an immediate shutdown. After recovery, thepage headers of the metapage will be incorrectly all-zeroes.Reported by Jeff Janes
1 parentf78329d commit47fe4d2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/backend/access/gin/ginxlog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ ginRedoUpdateMetapage(XLogReaderState *record)
512512
Assert(BufferGetBlockNumber(metabuffer)==GIN_METAPAGE_BLKNO);
513513
metapage=BufferGetPage(metabuffer);
514514

515+
GinInitPage(metapage,GIN_META,BufferGetPageSize(metabuffer));
515516
memcpy(GinPageGetMeta(metapage),&data->metadata,sizeof(GinMetaPageData));
516517
PageSetLSN(metapage,lsn);
517518
MarkBufferDirty(metabuffer);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp