Skip to content

Commit 1384771

Browse files
committed
Fix misleading output from gin_desc().
XLOG_GIN_UPDATE_META_PAGE and XLOG_GIN_DELETE_LISTPAGE records were printed with a list link field labeled as "blkno", which was confusing, especially when the link was empty (InvalidBlockNumber). Print the metapage block number instead, since that's what's actually being updated. We could include the link values too as a separate field, but not clear it's worth the trouble. Back-patch to 8.4 where the dubious code was added.
1 parent 9b4d973 commit 1384771

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/backend/access/gin/ginxlog.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,7 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
747747
(((ginxlogInsert *) rec)->isData) ? 'T' : 'F',
748748
(((ginxlogInsert *) rec)->isLeaf) ? 'T' : 'F',
749749
(((ginxlogInsert *) rec)->isDelete) ? 'T' : 'F',
750-
((ginxlogInsert *) rec)->updateBlkno
751-
);
752-
750+
((ginxlogInsert *) rec)->updateBlkno);
753751
break;
754752
case XLOG_GIN_SPLIT:
755753
appendStringInfo(buf, "Page split, ");
@@ -766,15 +764,15 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
766764
break;
767765
case XLOG_GIN_UPDATE_META_PAGE:
768766
appendStringInfo(buf, "Update metapage, ");
769-
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, ((ginxlogUpdateMeta *) rec)->metadata.tail);
767+
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, GIN_METAPAGE_BLKNO);
770768
break;
771769
case XLOG_GIN_INSERT_LISTPAGE:
772770
appendStringInfo(buf, "Insert new list page, ");
773771
desc_node(buf, ((ginxlogInsertListPage *) rec)->node, ((ginxlogInsertListPage *) rec)->blkno);
774772
break;
775773
case XLOG_GIN_DELETE_LISTPAGE:
776774
appendStringInfo(buf, "Delete list pages (%d), ", ((ginxlogDeleteListPages *) rec)->ndeleted);
777-
desc_node(buf, ((ginxlogDeleteListPages *) rec)->node, ((ginxlogDeleteListPages *) rec)->metadata.head);
775+
desc_node(buf, ((ginxlogDeleteListPages *) rec)->node, GIN_METAPAGE_BLKNO);
778776
break;
779777
default:
780778
elog(PANIC, "gin_desc: unknown op code %u", info);

0 commit comments

Comments
 (0)