mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-23 12:10:41 +02:00
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 is
only logged for _L variant nbtree page split WAL records.
Both issues were oversights in commit 2c03216d83
, which revamped the
WAL format.
Author: Peter Geoghegan
Backpatch: 9.5-, where the WAL format was revamped.
This commit is contained in:
parent
64d926f2b0
commit
e87b00b5f6
@ -40,8 +40,8 @@ btree_desc(StringInfo buf, XLogReaderState *record)
|
|||||||
{
|
{
|
||||||
xl_btree_split *xlrec = (xl_btree_split *) rec;
|
xl_btree_split *xlrec = (xl_btree_split *) rec;
|
||||||
|
|
||||||
appendStringInfo(buf, "level %u, firstright %d",
|
appendStringInfo(buf, "level %u, firstright %d, newitemoff %d",
|
||||||
xlrec->level, xlrec->firstright);
|
xlrec->level, xlrec->firstright, xlrec->newitemoff);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XLOG_BTREE_VACUUM:
|
case XLOG_BTREE_VACUUM:
|
||||||
|
@ -82,12 +82,12 @@ typedef struct xl_btree_insert
|
|||||||
*
|
*
|
||||||
* Note: the four XLOG_BTREE_SPLIT xl_info codes all use this data record.
|
* Note: the four XLOG_BTREE_SPLIT xl_info codes all use this data record.
|
||||||
* The _L and _R variants indicate whether the inserted tuple went into the
|
* The _L and _R variants indicate whether the inserted tuple went into the
|
||||||
* left or right split page (and thus, whether newitemoff and the new item
|
* left or right split page (and thus, whether the new item is stored or not).
|
||||||
* are stored or not). The _HIGHKEY variants indicate that we've logged
|
* The _HIGHKEY variants indicate that we've logged explicitly left page high
|
||||||
* explicitly left page high key value, otherwise redo should use right page
|
* key value, otherwise redo should use right page leftmost key as a left page
|
||||||
* leftmost key as a left page high key. _HIGHKEY is specified for internal
|
* high key. _HIGHKEY is specified for internal pages where right page
|
||||||
* pages where right page leftmost key is suppressed, and for leaf pages
|
* leftmost key is suppressed, and for leaf pages of covering indexes where
|
||||||
* of covering indexes where high key have non-key attributes truncated.
|
* high key have non-key attributes truncated.
|
||||||
*
|
*
|
||||||
* Backup Blk 0: original page / new left page
|
* Backup Blk 0: original page / new left page
|
||||||
*
|
*
|
||||||
@ -109,7 +109,7 @@ typedef struct xl_btree_split
|
|||||||
{
|
{
|
||||||
uint32 level; /* tree level of page being split */
|
uint32 level; /* tree level of page being split */
|
||||||
OffsetNumber firstright; /* first item moved to right page */
|
OffsetNumber firstright; /* first item moved to right page */
|
||||||
OffsetNumber newitemoff; /* new item's offset (if placed on left page) */
|
OffsetNumber newitemoff; /* new item's offset (useful for _L variant) */
|
||||||
} xl_btree_split;
|
} xl_btree_split;
|
||||||
|
|
||||||
#define SizeOfBtreeSplit (offsetof(xl_btree_split, newitemoff) + sizeof(OffsetNumber))
|
#define SizeOfBtreeSplit (offsetof(xl_btree_split, newitemoff) + sizeof(OffsetNumber))
|
||||||
|
Loading…
Reference in New Issue
Block a user