Skip to content

Commit 3a7fdb7

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 260b119 commit 3a7fdb7

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
@@ -743,9 +743,7 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
743743
(((ginxlogInsert *) rec)->isData) ? 'T' : 'F',
744744
(((ginxlogInsert *) rec)->isLeaf) ? 'T' : 'F',
745745
(((ginxlogInsert *) rec)->isDelete) ? 'T' : 'F',
746-
((ginxlogInsert *) rec)->updateBlkno
747-
);
748-
746+
((ginxlogInsert *) rec)->updateBlkno);
749747
break;
750748
case XLOG_GIN_SPLIT:
751749
appendStringInfo(buf, "Page split, ");
@@ -762,15 +760,15 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
762760
break;
763761
case XLOG_GIN_UPDATE_META_PAGE:
764762
appendStringInfo(buf, "Update metapage, ");
765-
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, ((ginxlogUpdateMeta *) rec)->metadata.tail);
763+
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, GIN_METAPAGE_BLKNO);
766764
break;
767765
case XLOG_GIN_INSERT_LISTPAGE:
768766
appendStringInfo(buf, "Insert new list page, ");
769767
desc_node(buf, ((ginxlogInsertListPage *) rec)->node, ((ginxlogInsertListPage *) rec)->blkno);
770768
break;
771769
case XLOG_GIN_DELETE_LISTPAGE:
772770
appendStringInfo(buf, "Delete list pages (%d), ", ((ginxlogDeleteListPages *) rec)->ndeleted);
773-
desc_node(buf, ((ginxlogDeleteListPages *) rec)->node, ((ginxlogDeleteListPages *) rec)->metadata.head);
771+
desc_node(buf, ((ginxlogDeleteListPages *) rec)->node, GIN_METAPAGE_BLKNO);
774772
break;
775773
default:
776774
elog(PANIC, "gin_desc: unknown op code %u", info);

0 commit comments

Comments
 (0)