Skip to content

Commit 09b236a

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 is only logged for _L variant nbtree page split WAL records. Both issues were oversights in commit 2c03216, which revamped the WAL format. Author: Peter Geoghegan Backpatch: 9.5-, where the WAL format was revamped.
1 parent b54cff2 commit 09b236a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/backend/access/rmgrdesc/nbtdesc.c

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

43-
appendStringInfo(buf, "level %u, firstright %d",
44-
xlrec->level, xlrec->firstright);
43+
appendStringInfo(buf, "level %u, firstright %d, newitemoff %d",
44+
xlrec->level, xlrec->firstright, xlrec->newitemoff);
4545
break;
4646
}
4747
case XLOG_BTREE_VACUUM:

src/include/access/nbtxlog.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ typedef struct xl_btree_insert
7878
*
7979
* Note: the four XLOG_BTREE_SPLIT xl_info codes all use this data record.
8080
* The _L and _R variants indicate whether the inserted tuple went into the
81-
* left or right split page (and thus, whether newitemoff and the new item
82-
* are stored or not). The _ROOT variants indicate that we are splitting
83-
* the root page, and thus that a newroot record rather than an insert or
84-
* split record should follow. Note that a split record never carries a
85-
* metapage update --- we'll do that in the parent-level update.
81+
* left or right split page (and thus, whether the new item is stored or not).
82+
* The _ROOT variants indicate that we are splitting the root page, and thus
83+
* that a newroot record rather than an insert or split record should follow.
84+
* Note that a split record never carries a metapage update --- we'll do that
85+
* in the parent-level update.
8686
*
8787
* Backup Blk 0: original page / new left page
8888
*
@@ -104,7 +104,7 @@ typedef struct xl_btree_split
104104
{
105105
uint32 level; /* tree level of page being split */
106106
OffsetNumber firstright; /* first item moved to right page */
107-
OffsetNumber newitemoff; /* new item's offset (if placed on left page) */
107+
OffsetNumber newitemoff; /* new item's offset (useful for _L variants) */
108108
} xl_btree_split;
109109

110110
#define SizeOfBtreeSplit (offsetof(xl_btree_split, newitemoff) + sizeof(OffsetNumber))

0 commit comments

Comments
 (0)