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

Commit22122c8

Browse files
committed
Fix full-page writes of internal GIN pages.
Insertion to a non-leaf GIN page didn't make a full-page image of the page,which is wrong. The code used to do it correctly, but was changed (commit853d1c3) because the redo-routine didn'ttrack incomplete splits correctly when the page was restored from a fullpage image. Of course, that was not right way to fix it, the redo routineshould've been fixed instead. The redo-routine was surreptitiously fixedin 2010 (commit4016bde), so all we needto do now is revert the code that creates the record to its original form.This doesn't change the format of the WAL record.Backpatch to all supported versions.
1 parent4a8adfd commit22122c8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,14 @@ dataPlaceToPage(GinBtree btree, Buffer buf, OffsetNumber off,
382382
data.nitem=1;
383383
}
384384

385-
rdata[0].buffer=InvalidBuffer;
385+
rdata[0].buffer=buf;
386+
rdata[0].buffer_std= false;
386387
rdata[0].data= (char*)&data;
387388
rdata[0].len= offsetof(ginxlogInsertDataLeaf,items);
388389
rdata[0].next=&rdata[1];
389390

390-
rdata[1].buffer=InvalidBuffer;
391+
rdata[1].buffer=buf;
392+
rdata[1].buffer_std= false;
391393
rdata[1].data= (char*)&items->items[savedPos];
392394
rdata[1].len=sizeof(ItemPointerData)*data.nitem;
393395
rdata[1].next=NULL;
@@ -398,7 +400,8 @@ dataPlaceToPage(GinBtree btree, Buffer buf, OffsetNumber off,
398400

399401
GinDataPageAddPostingItem(page,pitem,off);
400402

401-
rdata[0].buffer=InvalidBuffer;
403+
rdata[0].buffer=buf;
404+
rdata[0].buffer_std= false;
402405
rdata[0].data= (char*)pitem;
403406
rdata[0].len=sizeof(PostingItem);
404407
rdata[0].next=NULL;

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,15 @@ entryPlaceToPage(GinBtree btree, Buffer buf, OffsetNumber off,
523523

524524
data.isDelete=insertData->isDelete;
525525

526-
rdata[cnt].buffer=InvalidBuffer;
526+
rdata[cnt].buffer=buf;
527+
rdata[cnt].buffer_std= false;
527528
rdata[cnt].data= (char*)&data;
528529
rdata[cnt].len= offsetof(ginxlogInsertEntry,tuple);
529530
rdata[cnt].next=&rdata[cnt+1];
530531
cnt++;
531532

532-
rdata[cnt].buffer=InvalidBuffer;
533+
rdata[cnt].buffer=buf;
534+
rdata[cnt].buffer_std= false;
533535
rdata[cnt].data= (char*)insertData->entry;
534536
rdata[cnt].len=IndexTupleSize(insertData->entry);
535537
rdata[cnt].next=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp