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

Commit3b6b54f

Browse files
Fix nbtree page split rmgr desc routine.
Include newitemoff in rmgr desc output for nbtree page split records.In passing, correct an obsolete comment that claimed that newitemoff isonly logged for _L variant nbtree page split WAL records.Both issues were oversights in commit2c03216, which revamped theWAL format.Author: Peter GeogheganBackpatch: 9.5-, where the WAL format was revamped.
1 parent7f1f72c commit3b6b54f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

‎src/backend/access/rmgrdesc/nbtdesc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ btree_desc(StringInfo buf, XLogReaderState *record)
3838
{
3939
xl_btree_split*xlrec= (xl_btree_split*)rec;
4040

41-
appendStringInfo(buf,"level %u, firstright %d",
42-
xlrec->level,xlrec->firstright);
41+
appendStringInfo(buf,"level %u, firstright %d, newitemoff %d",
42+
xlrec->level,xlrec->firstright,xlrec->newitemoff);
4343
break;
4444
}
4545
caseXLOG_BTREE_VACUUM:

‎src/include/access/nbtxlog.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,12 @@ typedef struct xl_btree_insert
8282
*
8383
* Note: XLOG_BTREE_SPLIT_L and XLOG_BTREE_SPLIT_R share this data record.
8484
* There are two variants to indicate whether the inserted tuple went into the
85-
* left or right split page (and thus, whether newitemoff and the new item are
86-
* stored or not). We always log the left page high key because suffix
87-
* truncation can generate a new leaf high key using user-defined code. This
88-
* is also necessary on internal pages, since the first right item that the
89-
* left page's high key was based on will have been truncated to zero
90-
* attributes in the right page (the original is unavailable from the right
91-
* page).
85+
* left or right split page (and thus, whether the new item is stored or not).
86+
* We always log the left page high key because suffix truncation can generate
87+
* a new leaf high key using user-defined code. This is also necessary on
88+
* internal pages, since the first right item that the left page's high key
89+
* was based on will have been truncated to zero attributes in the right page
90+
* (the original is unavailable from the right page).
9291
*
9392
* Backup Blk 0: original page / new left page
9493
*
@@ -112,7 +111,7 @@ typedef struct xl_btree_split
112111
{
113112
uint32level;/* tree level of page being split */
114113
OffsetNumberfirstright;/* first item moved to right page */
115-
OffsetNumbernewitemoff;/* new item's offset (if placed on left page) */
114+
OffsetNumbernewitemoff;/* new item's offset (useful for _L variant) */
116115
}xl_btree_split;
117116

118117
#defineSizeOfBtreeSplit(offsetof(xl_btree_split, newitemoff) + sizeof(OffsetNumber))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp