Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0ab4db5

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 17b985b commit 0ab4db5

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
@@ -748,9 +748,7 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
748748
(((ginxlogInsert *) rec)->isData) ? 'T' : 'F',
749749
(((ginxlogInsert *) rec)->isLeaf) ? 'T' : 'F',
750750
(((ginxlogInsert *) rec)->isDelete) ? 'T' : 'F',
751-
((ginxlogInsert *) rec)->updateBlkno
752-
);
753-
751+
((ginxlogInsert *) rec)->updateBlkno);
754752
break;
755753
case XLOG_GIN_SPLIT:
756754
appendStringInfo(buf, "Page split, ");
@@ -767,15 +765,15 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
767765
break;
768766
case XLOG_GIN_UPDATE_META_PAGE:
769767
appendStringInfo(buf, "Update metapage, ");
770-
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, ((ginxlogUpdateMeta *) rec)->metadata.tail);
768+
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, GIN_METAPAGE_BLKNO);
771769
break;
772770
case XLOG_GIN_INSERT_LISTPAGE:
773771
appendStringInfo(buf, "Insert new list page, ");
774772
desc_node(buf, ((ginxlogInsertListPage *) rec)->node, ((ginxlogInsertListPage *) rec)->blkno);
775773
break;
776774
case XLOG_GIN_DELETE_LISTPAGE:
777775
appendStringInfo(buf, "Delete list pages (%d), ", ((ginxlogDeleteListPages *) rec)->ndeleted);
778-
desc_node(buf, ((ginxlogDeleteListPages *) rec)->node, ((ginxlogDeleteListPages *) rec)->metadata.head);
776+
desc_node(buf, ((ginxlogDeleteListPages *) rec)->node, GIN_METAPAGE_BLKNO);
779777
break;
780778
default:
781779
elog(PANIC, "gin_desc: unknown op code %u", info);

0 commit comments

Comments
 (0)